aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/ship_part.rb
blob: b6a8a506b4d434da36684e4b4f4eb2b10a46dd2c (plain) (blame)
1
2
3
4
5
6
7
class ShipPart < ActiveRecord::Base
  belongs_to :ship
  has_many :trinkets, :class_name => "Treasure", :as => :looter
  accepts_nested_attributes_for :trinkets, :allow_destroy => true

  validates_presence_of :name
end