Merged updates from trunk into stable branch
[feedcatcher.git] / vendor / rails / activerecord / test / models / ship.rb
diff --git a/vendor/rails/activerecord/test/models/ship.rb b/vendor/rails/activerecord/test/models/ship.rb
new file mode 100644 (file)
index 0000000..06759d6
--- /dev/null
@@ -0,0 +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, :reject_if => proc { |attributes| attributes.empty? }
+
+  validates_presence_of :name
+end