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 defining validations when op field is defined #66

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rsboggs
Copy link

@rsboggs rsboggs commented Sep 16, 2024

No description provided.

@rsboggs rsboggs force-pushed the field-validations branch 2 times, most recently from 080150a to 40ad60c Compare September 16, 2024 17:09
validation_str = value.is_a?(Hash) ? value.inspect : value

class_eval <<-RUBY, __FILE__, __LINE__ + 1
validates :#{field_name}, #{key}: #{validation_str}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it work with validates field_name, key => value?

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.

2 participants