appease our new robot overlords.
(I voted for Krang)
This commit is contained in:
@@ -36,7 +36,7 @@ class UsersController < ApplicationController
|
||||
message = true if user.save!
|
||||
respond_to do |format|
|
||||
format.html { redirect_to user_account_settings_path(user_id: current_user.id) }
|
||||
format.json { render :json => {:msg => message ? "success" : "false "} }
|
||||
format.json { render json: {msg: message ? "success" : "false "} }
|
||||
end
|
||||
else
|
||||
flash[:error] = "Could not update user!"
|
||||
|
||||
+4
-3
@@ -10,7 +10,7 @@ class User < ApplicationRecord
|
||||
|
||||
validates_presence_of :email
|
||||
validates_uniqueness_of :email
|
||||
validates_format_of :email, :with => /.+@.+\..+/i
|
||||
validates_format_of :email, with: /.+@.+\..+/i
|
||||
|
||||
has_one :retirement, dependent: :destroy
|
||||
has_one :paid_time_off, dependent: :destroy
|
||||
@@ -57,9 +57,10 @@ class User < ApplicationRecord
|
||||
end
|
||||
|
||||
def generate_token(column)
|
||||
begin
|
||||
loop do
|
||||
self[column] = Encryption.encrypt_sensitive_value(self.id)
|
||||
end while User.exists?(column => self[column])
|
||||
break unless User.exists?(column => self[column])
|
||||
end
|
||||
|
||||
self.save!
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user