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:
Benjamin Fleischer
2016-08-31 08:35:41 -05:00
committed by L. Preston Sego III
parent 7d2997b3ff
commit 20e394d512
6 changed files with 94 additions and 47 deletions

View File

@@ -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