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
Since upgrading to 3.0.1 some of my validate_numericality_of are failing with this error :
NoMethodError: undefined method `type' for nil:NilClass
from ~/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/shoulda-matchers-3.0.1/lib/shoulda/matchers/active_model/validate_numericality_of_matcher.rb:442:in `column_type'
After a little bit of research, this is because the attribute I'm not validating is not (directly) backed by a column. In my case, the attribute is a "shortcut" accessor for data nested in a json column (in postgre), so there is no column-type associated.
I don't know how this should be handled, but if someone were to point me in the right direction, I'd be happy to fix this myself and open a PR.
Thanks for your time, and have a nice day !
The text was updated successfully, but these errors were encountered:
Hello,
Since upgrading to 3.0.1 some of my
validate_numericality_of
are failing with this error :After a little bit of research, this is because the attribute I'm not validating is not (directly) backed by a column. In my case, the attribute is a "shortcut" accessor for data nested in a json column (in postgre), so there is no column-type associated.
I don't know how this should be handled, but if someone were to point me in the right direction, I'd be happy to fix this myself and open a PR.
Thanks for your time, and have a nice day !
The text was updated successfully, but these errors were encountered: