I’m trying to run the “validates_inclusion_of” method in a before_save
because the range is dependant on the related data. But I can’t figure
to call it. When calling it normally, it says it can’t find it.
I’ve tried several combinations like
“ActiveRecord::Validations.validates_inclusion_of”, but I can’t seem to
the logic in it. So, how do I call it?
This question could be generalised, because I never know what to call
something is not in de default namespace. For example, how do I know
“ActiveRecord::ConnectionAdapters::SQLServerAdapter.select_one” can be
“ActiveRecord::Base.connection.select_one”? I happen to know this one,
would have never guessed…
Thanks in advance.