aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/fixtures/memberships.yml
diff options
context:
space:
mode:
authoreileencodes <eileencodes@gmail.com>2014-06-09 18:45:29 -0400
committereileencodes <eileencodes@gmail.com>2014-07-08 08:49:19 -0400
commitf8d2899d12d59360f29c5eb6a1b1a8fe4ec82ca0 (patch)
treebf0b1f0fdbfbdfb8b082405c4e9886ea71c2ac20 /activerecord/test/fixtures/memberships.yml
parent0792d3e78b8aea5bf1c1401e9a33f2dd3bae4420 (diff)
downloadrails-f8d2899d12d59360f29c5eb6a1b1a8fe4ec82ca0.tar.gz
rails-f8d2899d12d59360f29c5eb6a1b1a8fe4ec82ca0.tar.bz2
rails-f8d2899d12d59360f29c5eb6a1b1a8fe4ec82ca0.zip
Begin refactoring ThroughReflection
This allows us to decouple AssociationReflection and ThroughReflection making ThroughReflection it's own Reflection bucket in a way. The benefit of this is to be able to remove checks against the macro's symbol for exmaple `macro == :belongs_to`. Get all tests passing again Some of the methods that used to be inherited from MacroReflection through AssociationReflection were no longer getting passed through. They needed to be duplicated into the ThroughReflection. I will extract these out into a separate class. Refactor shared methods into strategy object Now that we've separated ThroughReflection and AssociationReflection we can combine shared methods into one class to avoid duplication. Break out class for each type of reflection This creates a class for each reflection type (has_many, has_one, belongs_to and habtm). We then can remove the need to set the macro symbol in each initialization. Tests were updated to reflect these changes because creation of these reflections is now different. Remove need for @collection instance var We now define `collection?` as `false` by default and set it to `true` in `has_and_belongs_to_many` and `has_many` reflections. This removes the need for the `@collection` instance variable. Raise exception on unknown macro types We shouldn't accept just any macro when creating reflections. An unrecongnized AssociationReflection raises an error. Tests in `reflection_test` were updated to reflect these new changes. `:has_and_belongs_to_many` macro tests were removed because we no longer internally return HABTM.
Diffstat (limited to 'activerecord/test/fixtures/memberships.yml')
0 files changed, 0 insertions, 0 deletions