-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Delegate Serializer.attributes to Serializer.attribute #1167
Conversation
define_method attr do | ||
object && object.read_attribute_for_serialization(attr) | ||
end unless method_defined?(attr) || _fragmented.respond_to?(attr) | ||
attribute(attr) |
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.
👍
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.
much cleaner!
f886c2a
to
0504ad5
Compare
@_attributes_keys[attr] = { key: key } if key != attr | ||
@_attributes << key unless @_attributes.include?(key) | ||
self._attributes_keys[attr] = { key: key } if key != attr | ||
self._attributes << key unless self._attributes.include?(key) |
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.
I think this second use of _attributes violates the reference @beauby linked.... but I think it makes sense here.... so... :-\
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.
fixed
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.
what was fixed? (maybe I'm just missing it?)
self._attributes << key unless self._attributes.include?(key)
but, is this -----------------------------> ^ self supposed to be here?
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.
n/m wrong pr.. juggling...
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.
fixed fureal
needs rebase |
0504ad5
to
27812a1
Compare
27812a1
to
484426c
Compare
Delegate Serializer.attributes to Serializer.attribute
No description provided.