diff options
author | Eloy Duran <eloy.de.enige@gmail.com> | 2009-02-01 14:44:30 +1300 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2009-02-01 14:44:30 +1300 |
commit | ec8f04584479aff895b0b511a7ba1e9d33f84067 (patch) | |
tree | 86d6580345865cd1ce63b2055c0eca091ba8ee52 /activerecord/test/models/ship.rb | |
parent | a02d752ae408b34e048b7b040e28c36074a9119f (diff) | |
download | rails-ec8f04584479aff895b0b511a7ba1e9d33f84067.tar.gz rails-ec8f04584479aff895b0b511a7ba1e9d33f84067.tar.bz2 rails-ec8f04584479aff895b0b511a7ba1e9d33f84067.zip |
Add support for nested object forms to ActiveRecord and the helpers in ActionPack
Signed-Off-By: Michael Koziarski <michael@koziarski.com>
[#1202 state:committed]
Diffstat (limited to 'activerecord/test/models/ship.rb')
-rw-r--r-- | activerecord/test/models/ship.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/models/ship.rb b/activerecord/test/models/ship.rb index 05b09fc1b9..c46e27f3ae 100644 --- a/activerecord/test/models/ship.rb +++ b/activerecord/test/models/ship.rb @@ -1,3 +1,10 @@ class Ship < ActiveRecord::Base self.record_timestamps = false + + belongs_to :pirate + has_many :parts, :class_name => 'ShipPart', :autosave => true + + accepts_nested_attributes_for :pirate, :allow_destroy => true + + validates_presence_of :name end
\ No newline at end of file |