aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/pirate.rb
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2014-02-03 14:48:59 +0100
committerYves Senn <yves.senn@gmail.com>2014-02-03 14:48:59 +0100
commit584a46479b3cbcac37b948a7fe38fa3acc71c35b (patch)
tree5655ef520e67d4231a39bc32e71dec59ad14b328 /activerecord/test/models/pirate.rb
parentb7c7cb1a6379f861c04a1273c67fa8b46212f527 (diff)
downloadrails-584a46479b3cbcac37b948a7fe38fa3acc71c35b.tar.gz
rails-584a46479b3cbcac37b948a7fe38fa3acc71c35b.tar.bz2
rails-584a46479b3cbcac37b948a7fe38fa3acc71c35b.zip
pass `habtm :autosave` to underlying `hm:t` association. Closes #13923.
Diffstat (limited to 'activerecord/test/models/pirate.rb')
-rw-r--r--activerecord/test/models/pirate.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/test/models/pirate.rb b/activerecord/test/models/pirate.rb
index 170fc2ffe3..7bb0caf44b 100644
--- a/activerecord/test/models/pirate.rb
+++ b/activerecord/test/models/pirate.rb
@@ -13,6 +13,7 @@ class Pirate < ActiveRecord::Base
:after_add => proc {|p,pa| p.ship_log << "after_adding_proc_parrot_#{pa.id || '<new>'}"},
:before_remove => proc {|p,pa| p.ship_log << "before_removing_proc_parrot_#{pa.id}"},
:after_remove => proc {|p,pa| p.ship_log << "after_removing_proc_parrot_#{pa.id}"}
+ has_and_belongs_to_many :autosaved_parrots, class_name: "Parrot", autosave: true
has_many :treasures, :as => :looter
has_many :treasure_estimates, :through => :treasures, :source => :price_estimates