aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorEvan Petrie <ejp@charlie.local>2012-09-28 14:19:31 -0700
committerEvan Petrie <ejp@charlie.local>2012-09-28 14:19:31 -0700
commit8dbf337e0a7e4db521aa2f5f992609fae98c329e (patch)
tree307d6c7ae3b413ca29848daad294a38ec47ce276 /activerecord/test
parentddba97fa4f10319154e77d8f5e2c3e803f08e852 (diff)
downloadrails-8dbf337e0a7e4db521aa2f5f992609fae98c329e.tar.gz
rails-8dbf337e0a7e4db521aa2f5f992609fae98c329e.tar.bz2
rails-8dbf337e0a7e4db521aa2f5f992609fae98c329e.zip
backport 68677ffb8298105eb9d3efa26d928dd88cc5e006
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/relation_scoping_test.rb4
-rw-r--r--activerecord/test/cases/relations_test.rb4
2 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/relation_scoping_test.rb b/activerecord/test/cases/relation_scoping_test.rb
index cfcd11ca46..f33e765c59 100644
--- a/activerecord/test/cases/relation_scoping_test.rb
+++ b/activerecord/test/cases/relation_scoping_test.rb
@@ -548,4 +548,8 @@ class DefaultScopingTest < ActiveRecord::TestCase
end
threads.each(&:join)
end
+
+ def test_default_scope_unscoped_is_not_cached
+ assert_not_equal DeveloperCalledDavid.unscoped.object_id, DeveloperCalledDavid.unscoped.object_id
+ end
end
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb
index 7639585649..b24df47efd 100644
--- a/activerecord/test/cases/relations_test.rb
+++ b/activerecord/test/cases/relations_test.rb
@@ -1093,6 +1093,10 @@ class RelationTest < ActiveRecord::TestCase
assert_equal 'honda', FastCar.unscoped { FastCar.order_using_old_style.limit(1).first.name}
end
+ def test_unscoped_relation_clones
+ assert_not_equal CoolCar.unscoped.object_id, CoolCar.unscoped.object_id
+ end
+
def test_intersection_with_array
relation = Author.where(:name => "David")
rails_author = relation.first