forked from OpenNeo/impress
finally fix encased in ice - woo!
This commit is contained in:
parent
9fcc1b244a
commit
775ef7fa51
4 changed files with 29 additions and 14 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
27
db/schema.rb
27
db/schema.rb
|
@ -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
|
||||
|
@ -90,21 +90,22 @@ ActiveRecord::Schema.define(:version => 20120725232903) do
|
|||
add_index "login_cookies", ["user_id"], :name => "login_cookies_user_id"
|
||||
|
||||
create_table "objects", :force => true do |t|
|
||||
t.text "zones_restrict", :null => false
|
||||
t.text "thumbnail_url", :limit => 16777215, :null => false
|
||||
t.string "name", :limit => 100, :null => false
|
||||
t.text "description", :limit => 16777215, :null => false
|
||||
t.string "category", :limit => 50
|
||||
t.string "type", :limit => 50
|
||||
t.string "rarity", :limit => 25
|
||||
t.integer "rarity_index", :limit => 2
|
||||
t.integer "price", :limit => 3, :null => false
|
||||
t.integer "weight_lbs", :limit => 2
|
||||
t.text "species_support_ids", :limit => 16777215
|
||||
t.boolean "sold_in_mall", :null => false
|
||||
t.text "zones_restrict", :null => false
|
||||
t.text "thumbnail_url", :limit => 16777215, :null => false
|
||||
t.string "name", :limit => 100, :null => false
|
||||
t.text "description", :limit => 16777215, :null => false
|
||||
t.string "category", :limit => 50
|
||||
t.string "type", :limit => 50
|
||||
t.string "rarity", :limit => 25
|
||||
t.integer "rarity_index", :limit => 2
|
||||
t.integer "price", :limit => 3, :null => false
|
||||
t.integer "weight_lbs", :limit => 2
|
||||
t.text "species_support_ids", :limit => 16777215
|
||||
t.boolean "sold_in_mall", :null => false
|
||||
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"
|
||||
|
|
Loading…
Reference in a new issue