Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the use of the :if argument to call local methods #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

DangerDawson
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant