Conditional validations no longer accept strings for if/unless (#3124)
This commit is contained in:
parent
d2542dcec0
commit
6e4c7d6211
6 changed files with 13 additions and 9 deletions
|
@ -45,7 +45,7 @@ class User < ApplicationRecord
|
|||
belongs_to :account, inverse_of: :user, required: true
|
||||
accepts_nested_attributes_for :account
|
||||
|
||||
validates :locale, inclusion: I18n.available_locales.map(&:to_s), unless: 'locale.nil?'
|
||||
validates :locale, inclusion: I18n.available_locales.map(&:to_s), if: :locale?
|
||||
validates :email, email: true
|
||||
|
||||
scope :recent, -> { order(id: :desc) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue