mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Refactor Association into Field like everything else (#1897)
* Make assocations asserts easier to understand * Refactor Association into Field like everything else * Make assocation serializer/links/meta lazier * Push association deeper into relationship * Simplify association usage in relationships * Better naming of reflection parent serializer * Easier to read association method
This commit is contained in:
committed by
L. Preston Sego III
parent
7d2997b3ff
commit
20e394d512
@@ -74,8 +74,8 @@ module ActiveModel
|
||||
# @api private
|
||||
#
|
||||
def associate(reflection)
|
||||
key = reflection.options[:key]
|
||||
key ? self._reflections[key] = reflection : self._reflections[reflection.name] = reflection
|
||||
key = reflection.options[:key] || reflection.name
|
||||
self._reflections[key] = reflection
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user