Skip to content

Not allow hash syntax setting#291

Open
boie0025 wants to merge 1 commit intoremi:masterfrom
boie0025:nb/bugs/disallow_hash_syntax_setting
Open

Not allow hash syntax setting#291
boie0025 wants to merge 1 commit intoremi:masterfrom
boie0025:nb/bugs/disallow_hash_syntax_setting

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.

1 participant