impress/app/models/parent_swf_asset_relationship.rb

20 lines
356 B
Ruby
Raw Normal View History

class ParentSwfAssetRelationship < ActiveRecord::Base
set_table_name 'parents_swf_assets'
belongs_to :parent, :polymorphic => true
2011-01-27 13:35:46 -08:00
belongs_to :swf_asset
def item=(replacement)
self.parent = replacement
2010-05-16 17:45:30 -07:00
end
def pet_state
2011-01-27 13:35:46 -08:00
PetState.find(parent_id)
2010-05-16 17:45:30 -07:00
end
def pet_state=(replacement)
self.parent = replacement
end
end