validates_serialized
validates_serialized copied to clipboard
Allow the use of the :if argument to call local methods
Previous to this commit the following would fail silently:
validates_hash_keys :hash do
validates :key, presence: true, if: :if_method
end
def if_method
false
end
This PR allows us to call a locally scoped method only for the if: argument.
If you are happy with this PR we should probably add documentation