Conditional validations no longer accept strings for if/unless (#3124)
This commit is contained in:
committed by
Eugen Rochko
parent
d2542dcec0
commit
6e4c7d6211
@ -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) }
|
||||
|
Reference in New Issue
Block a user