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

Proposition: add a matcher chain for :method on field definition #36

Open
LucDelmon opened this issue Jul 22, 2020 · 1 comment
Open

Comments

@LucDelmon
Copy link

LucDelmon commented Jul 22, 2020

Hello,

Wouldn't it be revelant to add a chain to the matcher have_field to check for the method argument used to link a field to a method on the model ?

field :hello, String, null: false, method: :hello_world

The chain could be called :with_method or :linked_to_method

I don't know if it is in the spirit of the gem since it checks a bit more than just the schema definitions but it could be very useful

@khamusa
Copy link
Owner

khamusa commented Aug 6, 2020

Hi @LucDelmon thanks for the suggestion. I believe it is in the spirit of the gem, since we test to pursue correctness.

Would you be willing to give this feature a try? I'd gladly accept a PR on this.

Sorry for the delay on the response.

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

No branches or pull requests

2 participants