aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/finder_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-10-16 08:08:08 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-10-16 08:08:08 +0000
commitf575757ca47f2bbce9866e2a1b1f23b629352b92 (patch)
tree26a73b0b63a0421aacc2664998e59dc35400732a /activerecord/test/finder_test.rb
parentcfbd790ad3dbb9a5b8ee18b4e386abb412246d9e (diff)
downloadrails-f575757ca47f2bbce9866e2a1b1f23b629352b92.tar.gz
rails-f575757ca47f2bbce9866e2a1b1f23b629352b92.tar.bz2
rails-f575757ca47f2bbce9866e2a1b1f23b629352b92.zip
Qualified column names work in hash conditions, like :conditions => { 'comments.created_at' => ... }. Closes #9733.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7943 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/finder_test.rb')
-rw-r--r--activerecord/test/finder_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/finder_test.rb b/activerecord/test/finder_test.rb
index b45aabb1fb..10f5bd554d 100644
--- a/activerecord/test/finder_test.rb
+++ b/activerecord/test/finder_test.rb
@@ -160,6 +160,11 @@ class FinderTest < Test::Unit::TestCase
assert_raises(ActiveRecord::RecordNotFound) { Topic.find(1, :conditions => { :approved => true }) }
end
+ def test_find_on_hash_conditions_with_explicit_table_name
+ assert Topic.find(1, :conditions => { 'topics.approved' => false })
+ assert_raises(ActiveRecord::RecordNotFound) { Topic.find(1, :conditions => { 'topics.approved' => true }) }
+ end
+
def test_find_on_association_proxy_conditions
assert_equal [1, 2, 3, 5, 6, 7, 8, 9, 10], Comment.find_all_by_post_id(authors(:david).posts).map(&:id).sort
end