finally fix encased in ice - woo!

This commit is contained in:
Emi Matchu 2012-10-05 20:56:52 -05:00
parent 9fcc1b244a
commit 775ef7fa51
4 changed files with 29 additions and 14 deletions

View file

@ -316,6 +316,7 @@ class Item < ActiveRecord::Base
end
swf_asset.origin_object_data = asset_data
swf_asset.origin_pet_type = pet_type
swf_asset.item = item
# Build and update the relationship
relationship = existing_relationships_by_item_id_and_swf_asset_id[item.id][swf_asset.id] rescue nil

View file

@ -194,7 +194,11 @@ class SwfAsset < ActiveRecord::Base
end
def body_specific?
self.zone.type_id < 3
# If we already have assigned this a non-zero body id, or if the asset is
# in a body-specific zone, or if the item is explicitly labeled as
# body-specific (like Encased In Ice, which is body-specific but whose
# assets occupy Background Item), then this asset is body-specific.
(body_id? && body_id > 0) || self.zone.type_id < 3 || (@item && @item.explicitly_body_specific?)
end
def zone

View file

@ -0,0 +1,9 @@
class AddExplicitlyBodySpecificToObjects < ActiveRecord::Migration
def self.up
add_column :objects, :explicitly_body_specific, :boolean, :null => false, :default => false
end
def self.down
remove_column :objects, :explicitly_body_specific
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20120725232903) do
ActiveRecord::Schema.define(:version => 20121006010446) do
create_table "auth_servers", :force => true do |t|
t.string "short_name", :limit => 10, :null => false
@ -105,6 +105,7 @@ ActiveRecord::Schema.define(:version => 20120725232903) do
t.datetime "last_spidered"
t.datetime "created_at"
t.datetime "updated_at"
t.boolean "explicitly_body_specific", :default => false, :null => false
end
add_index "objects", ["last_spidered"], :name => "objects_last_spidered"