2007-10-26 01:56:46 -04:00
|
|
|
class Parrot < ActiveRecord::Base
|
2007-11-26 17:46:11 -05:00
|
|
|
set_inheritance_column :parrot_sti_class
|
2007-10-26 01:56:46 -04:00
|
|
|
has_and_belongs_to_many :pirates
|
|
|
|
has_and_belongs_to_many :treasures
|
2007-11-20 16:53:22 -05:00
|
|
|
has_many :loots, :as => :looter
|
2008-08-15 21:49:22 -04:00
|
|
|
alias_attribute :title, :name
|
2009-01-31 20:44:30 -05:00
|
|
|
|
|
|
|
validates_presence_of :name
|
2007-10-26 01:56:46 -04:00
|
|
|
end
|
2007-11-26 17:46:11 -05:00
|
|
|
|
|
|
|
class LiveParrot < Parrot
|
|
|
|
end
|
|
|
|
|
|
|
|
class DeadParrot < Parrot
|
|
|
|
belongs_to :killer, :class_name => 'Pirate'
|
|
|
|
end
|