aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-10-30 10:53:59 +0900
committerRyuta Kamizono <kamipo@gmail.com>2018-10-30 11:08:41 +0900
commitf5ddf817841b85de3595788b348d626beac33a05 (patch)
tree6e24f0f440db96b750f66b4bbeb186f0cb26f0d3 /activerecord/test/models
parentad3669ee110ef3a667be966e40777ab7911b1cc3 (diff)
downloadrails-f5ddf817841b85de3595788b348d626beac33a05.tar.gz
rails-f5ddf817841b85de3595788b348d626beac33a05.tar.bz2
rails-f5ddf817841b85de3595788b348d626beac33a05.zip
Exercise HABTM fixtures with foreign key constraints
Diffstat (limited to 'activerecord/test/models')
-rw-r--r--activerecord/test/models/parrot.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/models/parrot.rb b/activerecord/test/models/parrot.rb
index ba9ddb8c6a..3bb5316eca 100644
--- a/activerecord/test/models/parrot.rb
+++ b/activerecord/test/models/parrot.rb
@@ -20,6 +20,12 @@ class Parrot < ActiveRecord::Base
def increment_updated_count
self.updated_count += 1
end
+
+ def self.delete_all(*)
+ connection.delete("DELETE FROM parrots_pirates")
+ connection.delete("DELETE FROM parrots_treasures")
+ super
+ end
end
class LiveParrot < Parrot