diff options
Diffstat (limited to 'activerecord/test/associations_test.rb')
-rwxr-xr-x | activerecord/test/associations_test.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/activerecord/test/associations_test.rb b/activerecord/test/associations_test.rb index 699bc7a12f..735f012afe 100755 --- a/activerecord/test/associations_test.rb +++ b/activerecord/test/associations_test.rb @@ -1404,7 +1404,10 @@ class HasAndBelongsToManyAssociationsTest < Test::Unit::TestCase assert developer.save developer.projects << project developer.update_attribute("name", "Bruza") - assert_equal 1, developer.connection.select_one("SELECT count(*) FROM developers_projects WHERE - project_id = #{project.id} AND developer_id = #{developer.id}")["count(*)"].to_i + assert_equal 1, Developer.connection.select_value(<<-end_sql).to_i + SELECT count(*) FROM developers_projects + WHERE project_id = #{project.id} + AND developer_id = #{developer.id} + end_sql end end |