aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations
diff options
context:
space:
mode:
authorGlenn Vanderburg <glv@vanderburg.org>2011-01-28 18:16:44 -0600
committerSantiago Pastorino <santiago@wyeworks.com>2011-02-01 12:38:58 -0200
commit6bd9fac1e301d57765073e1f7a17e46972428205 (patch)
tree8514c120608bbace9eb9230a064a0c1eebc6e1a7 /activerecord/test/cases/associations
parent817e37013610c8e8866197594d5e408b4d5daec5 (diff)
downloadrails-6bd9fac1e301d57765073e1f7a17e46972428205.tar.gz
rails-6bd9fac1e301d57765073e1f7a17e46972428205.tar.bz2
rails-6bd9fac1e301d57765073e1f7a17e46972428205.zip
Propagate association extensions to scopes called on the association.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'activerecord/test/cases/associations')
-rw-r--r--activerecord/test/cases/associations/extension_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/extension_test.rb b/activerecord/test/cases/associations/extension_test.rb
index efaab8569e..e1f5b16eca 100644
--- a/activerecord/test/cases/associations/extension_test.rb
+++ b/activerecord/test/cases/associations/extension_test.rb
@@ -29,6 +29,11 @@ class AssociationsExtensionsTest < ActiveRecord::TestCase
assert_equal projects(:action_controller), developers(:david).projects_extended_by_name_and_block.find_most_recent
assert_equal projects(:active_record), developers(:david).projects_extended_by_name_and_block.find_least_recent
end
+
+ def test_extension_with_scopes
+ assert_equal comments(:greetings), posts(:welcome).comments.offset(1).find_most_recent
+ assert_equal comments(:greetings), posts(:welcome).comments.not_again.find_most_recent
+ end
def test_marshalling_extensions
david = developers(:david)