appease our new robot overlords.

(I voted for Krang)
This commit is contained in:
Joseph Mastey
2017-12-12 21:00:45 -06:00
parent 4587a5ff67
commit bb863f5156
9 changed files with 34 additions and 32 deletions
+1 -1
View File
@@ -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
View File
@@ -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