aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-09-27 16:51:12 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-09-27 16:51:12 -0700
commit133742d185c2abf0fb443b694a305a4b68259bcb (patch)
tree3693d2cf0b0419e0835c4b6de1cf04ff0205bdfc /activerecord/test
parentb1f5e90839a760c926403046ef43dd60af9fcf07 (diff)
downloadrails-133742d185c2abf0fb443b694a305a4b68259bcb.tar.gz
rails-133742d185c2abf0fb443b694a305a4b68259bcb.tar.bz2
rails-133742d185c2abf0fb443b694a305a4b68259bcb.zip
@klass also uses DynamicFinderMatch, so no need for it on the relation
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/relations_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb
index 3bc3671b77..d642aeed8b 100644
--- a/activerecord/test/cases/relations_test.rb
+++ b/activerecord/test/cases/relations_test.rb
@@ -32,6 +32,11 @@ class RelationTest < ActiveRecord::TestCase
assert_equal 5, Post.where(:id => post_authors).size
end
+ def test_dynamic_finder
+ x = Post.where('author_id = ?', 1)
+ assert x.klass.respond_to?(:find_by_id), '@klass should handle dynamic finders'
+ end
+
def test_multivalue_where
posts = Post.where('author_id = ? AND id = ?', 1, 1)
assert_equal 1, posts.to_a.size