diff options
author | eileencodes <eileencodes@gmail.com> | 2014-07-29 13:56:39 -0400 |
---|---|---|
committer | eileencodes <eileencodes@gmail.com> | 2014-07-31 11:07:25 -0400 |
commit | 377bece684715edd802ad73fee739669d15eafa6 (patch) | |
tree | 37ed45a35bcbcf1c0f9f4607ea01a66010c9dde7 /activerecord/test/models/admin/user.rb | |
parent | 84093c662770893ad840c36f2b99204593d4a7de (diff) | |
download | rails-377bece684715edd802ad73fee739669d15eafa6.tar.gz rails-377bece684715edd802ad73fee739669d15eafa6.tar.bz2 rails-377bece684715edd802ad73fee739669d15eafa6.zip |
Refactor join_keys to remove complex conditionals
Pushing conditionals down to through reflection
Only the through association needs the part of this conditional
that deals with belongs to and polymorphic? so that can be pushed
down into the ThroughReflection reducing the conditionals.
Remove conditional because we can delegate join keys to source reflection
Remove need for source_macro checking
By adding join_id_for to the other reflections we remove the need
to cehck against the source_macro and can reduce the conditioanl
from the original join_id_for(owner)
Using polymorphism instead of testing the source_macro
This case statement in join_association is almost exactly the same
as the original join_keys code. Testing taht theory by creating a
new join_dependency_keys(assoc_klass) method.
Refactor join_keys further to be more concise
Fixed format of "#:nodoc:" to "# :nodoc:" where I added them to this
file.
Diffstat (limited to 'activerecord/test/models/admin/user.rb')
0 files changed, 0 insertions, 0 deletions