Correct validators so that existing error messages would look correct (#3668)
This commit is contained in:
parent
1a065fb146
commit
cdff1da901
5 changed files with 23 additions and 22 deletions
|
@ -47,7 +47,7 @@ class User < ApplicationRecord
|
|||
accepts_nested_attributes_for :account
|
||||
|
||||
validates :locale, inclusion: I18n.available_locales.map(&:to_s), if: :locale?
|
||||
validates :email, email: true, if: :email_changed?
|
||||
validates_with BlacklistedEmailValidator, if: :email_changed?
|
||||
|
||||
scope :recent, -> { order(id: :desc) }
|
||||
scope :admins, -> { where(admin: true) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue