diff options
author | eileencodes <eileencodes@gmail.com> | 2014-06-09 18:45:29 -0400 |
---|---|---|
committer | eileencodes <eileencodes@gmail.com> | 2014-07-08 08:49:19 -0400 |
commit | f8d2899d12d59360f29c5eb6a1b1a8fe4ec82ca0 (patch) | |
tree | bf0b1f0fdbfbdfb8b082405c4e9886ea71c2ac20 /ci | |
parent | 0792d3e78b8aea5bf1c1401e9a33f2dd3bae4420 (diff) | |
download | rails-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 'ci')
0 files changed, 0 insertions, 0 deletions