diff options
author | Emilio Tagua <miloops@gmail.com> | 2009-10-05 15:25:06 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2009-10-05 15:25:06 -0300 |
commit | 1daceeb838dccfd47547dedea67eb22e7c06c5a9 (patch) | |
tree | 506ad932a341befbbea1d4ea719d992ef22f3512 /activerecord/lib/active_record/associations.rb | |
parent | 9a71b6d29d013d8ee3f0d3f408d53e1cf3c9f799 (diff) | |
parent | 65f055a3ed790d41aeca8d4ca7f3771b05cf544f (diff) | |
download | rails-1daceeb838dccfd47547dedea67eb22e7c06c5a9.tar.gz rails-1daceeb838dccfd47547dedea67eb22e7c06c5a9.tar.bz2 rails-1daceeb838dccfd47547dedea67eb22e7c06c5a9.zip |
Merge branch 'associations_2'
Diffstat (limited to 'activerecord/lib/active_record/associations.rb')
-rwxr-xr-x | activerecord/lib/active_record/associations.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 1e1f1a4c57..0888c41396 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1458,9 +1458,9 @@ module ActiveRecord after_destroy(method_name) end - def find_with_associations(options = {}) + def find_with_associations(options = {}, join_dependency = nil) catch :invalid_query do - join_dependency = JoinDependency.new(self, merge_includes(scope(:find, :include), options[:include]), options[:joins]) + join_dependency ||= JoinDependency.new(self, merge_includes(scope(:find, :include), options[:include]), options[:joins]) rows = select_all_rows(options, join_dependency) return join_dependency.instantiate(rows) end |