fix bug where some pet states would also show many items on top of them

At first I thought this was an error in the data migration process when moving SWF assets
to having their own unique IDs, but then realized that the query for a pet state's SWFs
didn't include the (parent_type = 'Item') condition. Oops. Turns out, I only connected the
items to parent_swf_asset_relationships polymorphically. Pet states were still doing it the
hackish way. Set the pet states to use the lovely polymorphic relationship and we're good
to go.
This commit is contained in:
Emi Matchu 2012-02-21 13:25:11 -06:00
parent 4d314417e2
commit baae0c9954

View file

@ -3,7 +3,7 @@ class PetState < ActiveRecord::Base
has_many :contributions, :as => :contributed # in case of duplicates being merged has_many :contributions, :as => :contributed # in case of duplicates being merged
has_many :outfits has_many :outfits
has_many :parent_swf_asset_relationships, :foreign_key => 'parent_id', has_many :parent_swf_asset_relationships, :as => :parent,
:autosave => false :autosave => false
has_many :swf_assets, :through => :parent_swf_asset_relationships has_many :swf_assets, :through => :parent_swf_asset_relationships