Permalink
Browse files

just set the default argument, a nil parent should be an error

  • Loading branch information...
1 parent 220f1a0 commit 26fd5f0cd58814a0391ea681aacf98370cc079a8 @tenderlove tenderlove committed May 22, 2013
Showing with 1 addition and 2 deletions.
  1. +1 −2 activerecord/lib/active_record/associations/join_dependency.rb
@@ -131,8 +131,7 @@ def cache_joined_association(association)
ref[association.reflection.name] ||= {}
end
- def build(associations, parent = nil, join_type = Arel::InnerJoin)
- parent ||= join_parts.last
+ def build(associations, parent = join_parts.last, join_type = Arel::InnerJoin)
case associations
when Symbol, String
reflection = parent.reflections[associations.intern] or

0 comments on commit 26fd5f0

Please sign in to comment.