aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/associations_join_model_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-09-01 05:31:56 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-09-01 05:31:56 +0000
commitb1257d96b7b2482fc7811e5dc12d71c9fa091d10 (patch)
tree244c5033c18cf4de0745f5d01def696accd618bc /activerecord/test/associations_join_model_test.rb
parent9c99be88b2806600f768b74bcfff1bc93de8c5ef (diff)
downloadrails-b1257d96b7b2482fc7811e5dc12d71c9fa091d10.tar.gz
rails-b1257d96b7b2482fc7811e5dc12d71c9fa091d10.tar.bz2
rails-b1257d96b7b2482fc7811e5dc12d71c9fa091d10.zip
has_many :through conditions are sanitized by the associating class. Closes #5971.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4893 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/associations_join_model_test.rb')
-rw-r--r--activerecord/test/associations_join_model_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/associations_join_model_test.rb b/activerecord/test/associations_join_model_test.rb
index 77908d4540..fb8df9c21c 100644
--- a/activerecord/test/associations_join_model_test.rb
+++ b/activerecord/test/associations_join_model_test.rb
@@ -246,6 +246,10 @@ class AssociationsJoinModelTest < Test::Unit::TestCase
def test_has_many_find_first
assert_equal categories(:general), authors(:david).categories.find(:first)
end
+
+ def test_has_many_with_hash_conditions
+ assert_equal categories(:general), authors(:david).categories_like_general.find(:first)
+ end
def test_has_many_find_conditions
assert_equal categories(:general), authors(:david).categories.find(:first, :conditions => "categories.name = 'General'")