aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2009-08-18 16:35:33 -0300
committerEmilio Tagua <miloops@gmail.com>2009-08-18 16:35:33 -0300
commit74ed123e082a9b2b160ddecc2eb141f1678c600a (patch)
treef22be82f6173693baed83a264cb52df99239076a /activerecord/test
parentfefb4c78ac8f37ea0b14cbb0c008f305a1bbd36f (diff)
downloadrails-74ed123e082a9b2b160ddecc2eb141f1678c600a.tar.gz
rails-74ed123e082a9b2b160ddecc2eb141f1678c600a.tar.bz2
rails-74ed123e082a9b2b160ddecc2eb141f1678c600a.zip
Override respond_to? in ActiveRecord::Relation to go with
method_missing.
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/relations_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb
index b017570b45..6a39aa6e40 100644
--- a/activerecord/test/cases/relations_test.rb
+++ b/activerecord/test/cases/relations_test.rb
@@ -71,5 +71,13 @@ class RelationTest < ActiveRecord::TestCase
).to_a
assert_equal 1, person_with_reader_and_post.size
end
+
+ def test_relation_responds_to_delegated_methods
+ relation = Topic.all
+
+ ["map", "uniq", "sort", "insert", "delete", "update"].each do |method|
+ assert relation.respond_to?(method)
+ end
+ end
end