Permalink
Browse files

eliminate function that is only used in one place

  • Loading branch information...
1 parent 99ff735 commit 5a0cca739a42c60fc852b42eb2b36c457981dce2 @tenderlove tenderlove committed Oct 9, 2013
Showing with 2 additions and 7 deletions.
  1. +2 −7 activerecord/lib/active_record/associations/join_dependency.rb
@@ -234,16 +234,11 @@ def build_join_association(reflection, parent, join_type)
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]

0 comments on commit 5a0cca7

Please sign in to comment.