Change deprecated changed? methods to new in callbacks

This commit is contained in:
Alex Sherman 2020-01-29 15:41:03 +05:00
parent 95ad3086b0
commit 01114386b3
7 changed files with 14 additions and 9 deletions

View file

@ -4,7 +4,7 @@ class AdminUser < User
validates :identity_code, presence: true, if: -> { country_code == 'EE' }
validates :email, presence: true
validates :password, :password_confirmation, presence: true, if: :new_record?
validates :password_confirmation, presence: true, if: :encrypted_password_changed?
validates :password_confirmation, presence: true, if: :will_save_change_to_encrypted_password?
validate :validate_identity_code, if: -> { country_code == 'EE' }
ROLES = %w(user customer_service admin) # should not match to api_users roles