aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2012-05-18 21:11:34 +0100
committerJon Leighton <j@jonathanleighton.com>2012-05-18 21:11:34 +0100
commitdcc576df8f4e6dfb2ef9891454b771c7d47ea219 (patch)
treef2ae25cba421e373bb8815993036f6cbe45b05b7 /activerecord/test/cases/associations
parenta1dd00810cccc40c66ffdf463c50c26452023353 (diff)
downloadrails-dcc576df8f4e6dfb2ef9891454b771c7d47ea219.tar.gz
rails-dcc576df8f4e6dfb2ef9891454b771c7d47ea219.tar.bz2
rails-dcc576df8f4e6dfb2ef9891454b771c7d47ea219.zip
fix #delete_all with habtm with :delete_sql
Diffstat (limited to 'activerecord/test/cases/associations')
-rw-r--r--activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb6
1 files changed, 6 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 0e361456f0..ed1caa2ef5 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
@@ -380,6 +380,12 @@ class HasAndBelongsToManyAssociationsTest < ActiveRecord::TestCase
assert_equal 0, active_record.developers_by_sql(true).size
end
+ def test_deleting_all_with_sql
+ project = Project.find(1)
+ project.developers_by_sql.delete_all
+ assert_equal 0, project.developers_by_sql.size
+ end
+
def test_deleting_all
david = Developer.find(1)
david.projects.reload