diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-29 13:32:02 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-29 13:32:02 -0800 |
commit | 9f2e885ce8d5cbf6999b22e274ec245d9007131d (patch) | |
tree | 1897c1538761c40687e71fdbe47222a0f19c8f65 /activerecord/test | |
parent | aae3c3538492f19f1c4e1fcfe6c942ff72a30ce1 (diff) | |
download | rails-9f2e885ce8d5cbf6999b22e274ec245d9007131d.tar.gz rails-9f2e885ce8d5cbf6999b22e274ec245d9007131d.tar.bz2 rails-9f2e885ce8d5cbf6999b22e274ec245d9007131d.zip |
testing attributes applied by default_scope
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/relation_scoping_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/relation_scoping_test.rb b/activerecord/test/cases/relation_scoping_test.rb index dae9721a63..c7f7738248 100644 --- a/activerecord/test/cases/relation_scoping_test.rb +++ b/activerecord/test/cases/relation_scoping_test.rb @@ -464,6 +464,11 @@ class DefaultScopingTest < ActiveRecord::TestCase assert_equal 50000, PoorDeveloperCalledJamis.create!(:name => 'David').salary end + def test_default_scope_attribute + jamis = PoorDeveloperCalledJamis.new(:name => 'David') + assert_equal 50000, jamis.salary + end + def test_scope_composed_by_limit_and_then_offset_is_equal_to_scope_composed_by_offset_and_then_limit posts_limit_offset = Post.limit(3).offset(2) posts_offset_limit = Post.offset(2).limit(3) |