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

Not allow hash syntax setting #291

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

boie0025
Copy link

I was attempting to set an attribute on a Her model object using the hash syntax and came across a strange error

> subject[:some_attribute] = "bar" 
# => ArgumentError: wrong number of arguments (2 for 1) ... /lib/her/model/attributes.rb:193

Investigation revealed that Her was interpreting [] as a hash key, therefore the expected hash key was used as the value for the key []. This PR is a quick change that stops Her from using [] as a hash key with a setter.

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.

None yet

1 participant