1
0
Fork 0
forked from OpenNeo/impress

Remove the Item::Translation model entirely

Okay, Impress 2020 is migrated off translations too, so we can start to
wrap this up!
This commit is contained in:
Emi Matchu 2024-02-20 16:57:45 -08:00
parent b7296d6a75
commit 1e6ff4cefc

View file

@ -6,13 +6,6 @@ class Item < ApplicationRecord
SwfAssetType = 'object' SwfAssetType = 'object'
# Keep the reference to the deprecated `Item::Translation` record, but don't
# bind it directly to any attributes anymore. We have some temporary writers
# that hack around the API to keep the attributes synced, while no longer
# reading *from* them by default.
# TODO: Remove once we're all done with translations, both here and in 2020!
translates
has_many :closet_hangers has_many :closet_hangers
has_one :contribution, :as => :contributed, :inverse_of => :contributed has_one :contribution, :as => :contributed, :inverse_of => :contributed
has_many :parent_swf_asset_relationships, :as => :parent has_many :parent_swf_asset_relationships, :as => :parent
@ -112,24 +105,6 @@ class Item < ApplicationRecord
distinct distinct
} }
# Temporary writers to keep the English translation record updated, while
# primarily using the attributes on the model itself.
#
# Once this app and DTI 2020 are both comfortably off the translation system,
# we can remove this!
def name=(new_name)
globalize.write(:en, :name, new_name)
write_attribute(:name, new_name)
end
def description=(new_description)
globalize.write(:en, :description, new_description)
write_attribute(:description, new_description)
end
def rarity=(new_rarity)
globalize.write(:en, :rarity, new_rarity)
write_attribute(:rarity, new_rarity)
end
def nc_trade_value def nc_trade_value
return nil unless nc? return nil unless nc?
begin begin