aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2013-03-15 14:44:48 +0100
committerYves Senn <yves.senn@gmail.com>2013-03-15 16:07:05 +0100
commit34402c762384336badbce0e2d20dbbe580c88cbe (patch)
tree41d5da7d4372fb64db8290a2cf8b37e1fd7e02bc /activerecord/test
parent0721d3b37062eca73da3efd669142d7e381e4d80 (diff)
downloadrails-34402c762384336badbce0e2d20dbbe580c88cbe.tar.gz
rails-34402c762384336badbce0e2d20dbbe580c88cbe.tar.bz2
rails-34402c762384336badbce0e2d20dbbe580c88cbe.zip
make it possible to disable implicit join references.
Closes #9712.
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/relations_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb
index db81ceeb52..fed1b4a8e8 100644
--- a/activerecord/test/cases/relations_test.rb
+++ b/activerecord/test/cases/relations_test.rb
@@ -1224,6 +1224,15 @@ class RelationTest < ActiveRecord::TestCase
end
end
+ def test_turn_off_eager_loading_with_conditions_on_joins
+ original_value = ActiveRecord::Base.disable_implicit_join_references
+ ActiveRecord::Base.disable_implicit_join_references = true
+ scope = Topic.where(author_email_address: 'my.example@gmail.com').includes(:replies)
+ assert_not scope.eager_loading?
+ ensure
+ ActiveRecord::Base.time_zone_aware_attributes = original_value
+ end
+
def test_ordering_with_extra_spaces
assert_equal authors(:david), Author.order('id DESC , name DESC').last
end