-
Notifications
You must be signed in to change notification settings - Fork 142
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
Is there a way to determine whether a hash's key was given? #408
Comments
Inspecting the code, it seems that the relevant line is here. @_interaction_keys = inputs.keys.to_set & self.class.filters.keys This seems to imply that the feature I'm hoping for does not exist. Maybe I'm missing a way around this though. Any thoughts? Thanks! |
You're right, we don't currently support this. |
I feel like this makes sense to add. We could allow |
I had not heard of |
That seems like a really intuitive solution to me. I'm not sure how array indices could not be 'given' if they existed, but I only just starting using Ruby. |
It seems like we all think this is a good direction. I should be able to build this out later this week when I've got some time. |
I'm allowing
nil
as an input for any of these, but I also want to know whether someone specifiednil
or whether it's just the default because the key was unspecified. That's fine when we're not dealing with a hash, but when we are, I seem to be running into issues.I know that I can determine whether
attributes
was passed by askinggiven? :attributes
, but how can I determine whetherattributes[:description]
was given?Thank you for a wonderful gem! The interaction pattern really makes Rails shine!
The text was updated successfully, but these errors were encountered: