-
Notifications
You must be signed in to change notification settings - Fork 474
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
Fixes to_hash
to include readonly attributes
#941
Fixes to_hash
to include readonly attributes
#941
Conversation
a49146f
to
143c24d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, but a thought on the default value
143c24d
to
3cb802b
Compare
Adds parameter to `to_hash` so that default behaviour includes readonly attributes; setting the parameter to `true` indicates that `to_hash` is being used to serialize the object for saving (and thus excludes readonly attributes). Fixes issue #930
3cb802b
to
8b3b27a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just had nits.
9e8dc97
to
31dea0a
Compare
31dea0a
to
3634cf7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great refactorings!
Description
Fixes issue #930
Adds parameter to
to_hash
so that default behaviour includes readonly attributes; setting the parameter totrue
indicates thatto_hash
is being used to serialize the object for saving (and thus excludes readonly attributes).How has this been tested?
Added tests to verify that readonly attributes are included when using the default
to_hash
and excluded when usingto_hash(true)
(i.e,saving = true
).Checklist: