diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-08 19:09:13 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-08 19:09:13 -0700 |
commit | 5a0cca739a42c60fc852b42eb2b36c457981dce2 (patch) | |
tree | c13447ecf421af3f94d914e1c81fb960f7c4261d /activerecord/lib | |
parent | 99ff735eea6f5872042fcdd944bdde82de7ad3ce (diff) | |
download | rails-5a0cca739a42c60fc852b42eb2b36c457981dce2.tar.gz rails-5a0cca739a42c60fc852b42eb2b36c457981dce2.tar.bz2 rails-5a0cca739a42c60fc852b42eb2b36c457981dce2.zip |
eliminate function that is only used in one place
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency.rb | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb index e42736ee8b..00321042a8 100644 --- a/activerecord/lib/active_record/associations/join_dependency.rb +++ b/activerecord/lib/active_record/associations/join_dependency.rb @@ -234,16 +234,11 @@ module ActiveRecord def construct(parent, nodes, row, rs) nodes.sort_by { |k| k.name }.each do |node| - assoc = node.children - association = construct_scalar(parent, row, rs, node) - construct(association, assoc, row, rs) if association + association = construct_association(parent, node.join_part, row, rs) + construct(association, node.children, row, rs) if association end end - def construct_scalar(parent, row, rs, node) - construct_association(parent, node.join_part, row, rs) - end - def construct_association(record, join_part, row, rs) caster = rs.column_type(join_part.parent.aliased_primary_key) row_id = caster.type_cast row[join_part.parent.aliased_primary_key] |