diff options
Diffstat (limited to 'activerecord/test/models/ship.rb')
-rw-r--r-- | activerecord/test/models/ship.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/test/models/ship.rb b/activerecord/test/models/ship.rb index 75c792d176..3da031946f 100644 --- a/activerecord/test/models/ship.rb +++ b/activerecord/test/models/ship.rb @@ -3,8 +3,9 @@ class Ship < ActiveRecord::Base belongs_to :pirate belongs_to :update_only_pirate, :class_name => 'Pirate' - has_many :parts, :class_name => 'ShipPart', :autosave => true + has_many :parts, :class_name => 'ShipPart' + accepts_nested_attributes_for :parts, :allow_destroy => true accepts_nested_attributes_for :pirate, :allow_destroy => true, :reject_if => proc { |attributes| attributes.empty? } accepts_nested_attributes_for :update_only_pirate, :update_only => true |