diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-05-21 20:13:29 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-05-21 20:13:29 -0700 |
commit | 26fd5f0cd58814a0391ea681aacf98370cc079a8 (patch) | |
tree | 7a8b60b8d664137cba436f11939b743aa11d4690 | |
parent | 220f1a0cfbf0e63eb200eb0bd9b58405cfa1b6e4 (diff) | |
download | rails-26fd5f0cd58814a0391ea681aacf98370cc079a8.tar.gz rails-26fd5f0cd58814a0391ea681aacf98370cc079a8.tar.bz2 rails-26fd5f0cd58814a0391ea681aacf98370cc079a8.zip |
just set the default argument, a nil parent should be an error
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb index 246512fcd0..5aa17e5fbb 100644 --- a/activerecord/lib/active_record/associations/join_dependency.rb +++ b/activerecord/lib/active_record/associations/join_dependency.rb @@ -131,8 +131,7 @@ module ActiveRecord 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 |