Skip to content

Conversation

@akoltun
Copy link

@akoltun akoltun commented Nov 7, 2016

The following code has been used in the Disposable::Twin::Property::Struct#read_value_for to read the attribute value from the model:
@model[name.to_s] || @model[name.to_sym]

If the model is a Hash with string keys and the attribute value is false the left part will be false and the result will be equal to the right part which is nil since hash keys are strings but not symbols.

Alexander Koltun added 2 commits November 7, 2016 14:20
…:Property::Struct module. Model attribute which name is specified by String and value is equal to false returns nil value instead of false value.
…ecified by String and value is equal to false
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