Open
Description
If you use Active Record Store to store attributes in a serialized field, the ActiveRecordValidator
does not work. This is because the validator tries to get the value of the field from accessing it as a hash instead of calling the AR method.
https://github.com/afair/email_address/blob/master/lib/email_address/active_record_validator.rb#L39
Consider this scenario:
class MyClass < ActiveRecord::Base
self.abstract_class = true
store_accessor :config
validates_with EmailAddress::ActiveRecordValidator, field: :support_email
end
> a = MyClass.new
> a.support_email = 'invalid email'
> a.support_email
'invalid email'
> a.valid?
true
I made a PR to fix this, in the hopes that someone can review and approve it soon.
Metadata
Metadata
Assignees
Labels
No labels