diff options
author | Nathan Witmer <nwitmer@gmail.com> | 2008-08-16 13:38:01 -0600 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-08-16 22:23:48 +0100 |
commit | 8cfdcdb35db6e2f6fd5a72a38f4352beab148af1 (patch) | |
tree | 73ee2a1467cfa181807625b7bba10e3bec15b27b /activerecord/test/cases | |
parent | 2b69a636c431d62a85b2896d87b69cb13e2b8af0 (diff) | |
download | rails-8cfdcdb35db6e2f6fd5a72a38f4352beab148af1.tar.gz rails-8cfdcdb35db6e2f6fd5a72a38f4352beab148af1.tar.bz2 rails-8cfdcdb35db6e2f6fd5a72a38f4352beab148af1.zip |
Updated has_and_belongs_to_many association to fix :finder_sql interpolation. [#848 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb b/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb index f71b122ff0..dfd82534ff 100644 --- a/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb @@ -450,6 +450,13 @@ class HasAndBelongsToManyAssociationsTest < ActiveRecord::TestCase assert_equal developers(:david), active_record.developers_with_finder_sql.find(developers(:david).id), "Ruby find" end + def test_find_in_association_with_custom_finder_sql_and_multiple_interpolations + # interpolate once: + assert_equal [developers(:david), developers(:poor_jamis), developers(:jamis)], projects(:active_record).developers_with_finder_sql, "first interpolation" + # interpolate again, for a different project id + assert_equal [developers(:david)], projects(:action_controller).developers_with_finder_sql, "second interpolation" + end + def test_find_in_association_with_custom_finder_sql_and_string_id assert_equal developers(:david), projects(:active_record).developers_with_finder_sql.find(developers(:david).id.to_s), "SQL find" end |