aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/relation_scoping_test.rb
diff options
context:
space:
mode:
authorMarcelo Giorgi <marklazz.uy@gmail.com>2010-09-23 19:16:07 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2010-09-24 20:24:54 -0300
commit72543b2e6358a502257a0e1eac61b0e3164937dd (patch)
tree5066a2967be3c67546425bac656169a5b9265901 /activerecord/test/cases/relation_scoping_test.rb
parenta0db7be4aff6fc6ebf67bbbd441c47d678bd5195 (diff)
downloadrails-72543b2e6358a502257a0e1eac61b0e3164937dd.tar.gz
rails-72543b2e6358a502257a0e1eac61b0e3164937dd.tar.bz2
rails-72543b2e6358a502257a0e1eac61b0e3164937dd.zip
Delegate ActiveRecord::Base.offset to scoped methods (analogous to limit) [#5688 state:resolved]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'activerecord/test/cases/relation_scoping_test.rb')
-rw-r--r--activerecord/test/cases/relation_scoping_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/relation_scoping_test.rb b/activerecord/test/cases/relation_scoping_test.rb
index b571e9a8b8..090e6c8bc9 100644
--- a/activerecord/test/cases/relation_scoping_test.rb
+++ b/activerecord/test/cases/relation_scoping_test.rb
@@ -425,4 +425,10 @@ class DefaultScopingTest < ActiveRecord::TestCase
assert_equal nil, PoorDeveloperCalledJamis.create!(:salary => nil).salary
assert_equal 50000, PoorDeveloperCalledJamis.create!(:name => 'David').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)
+ assert_equal posts_limit_offset, posts_offset_limit
+ end
end