Skip to content

Conversation

@mat813
Copy link
Member

@mat813 mat813 commented Apr 14, 2011

In Rails, the parameters we get from the web are all strings, but bitmask-attribute uses symbols. passing it strings is not a problem, as it gets it right, but it keeps the string in it's cache and it's a mess :

>> c.code
[
    [0] :power
]
>> c.code?(:power)
true
>> c.code?('power')
false
>> c.update_attributes("code" => ["power"])
true
>> c.code?(:power)
false
>> c.code?('power')
true
>> c.code
[
    [0] "power"
]

With this commit, it does :

>> c.code
[
    [0] :power
]
>> c.update_attributes("code" => ["power"])
true
>> c.code?(:power)
true
>> c.code 
[
    [0] :power
]

@mat813 mat813 closed this Apr 14, 2011
mat813 pushed a commit that referenced this pull request Oct 17, 2011
Symbols fixup to ensure that values are always returned as symbols regardless of how they were cast.
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