You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a model that's not an ActiveRecord subclass:
class Demo
include ActiveModel::Validations
include ActiveModel::Conversion
extend ActiveModel::Naming
def initialize(attributes = {})
attributes.each do |name, value|
send("#{name}=", value)
end
end
def persisted?
false
end
attr_accessor :phone
validates_plausible_phone :phone
end
It has this validator:
validates :phone, :phony_plausible => true
But I've also tried:
validates_plausible_phone :phone
Either way, when I attempt to save with an invalid phone number, the validation message displayed to the user is:
I have a model that's not an ActiveRecord subclass:
It has this validator:
But I've also tried:
Either way, when I attempt to save with an invalid phone number, the validation message displayed to the user is:
If I use the validators on an ActiveRecord-backed model:
I get the correct validation message:
I'm happy to manually add the translation but I was just wondering if this is expected?
The text was updated successfully, but these errors were encountered: