forked from OpenNeo/impress
Reorder the higher-up lines of SwfAsset
A lot of stuff was mixed together, including methods interrupting the scopes and relationships, oops! Fixed!
This commit is contained in:
parent
e8737a520e
commit
cf1cdf7e7d
1 changed files with 10 additions and 10 deletions
|
@ -8,6 +8,9 @@ class SwfAsset < ApplicationRecord
|
|||
# We use the `type` column to mean something other than what Rails means!
|
||||
self.inheritance_column = nil
|
||||
|
||||
# Used in `item_is_body_specific?`. (TODO: Could we refactor this out?)
|
||||
attr_accessor :item
|
||||
|
||||
IMAGE_SIZES = {
|
||||
:small => [150, 150],
|
||||
:medium => [300, 300],
|
||||
|
@ -16,9 +19,16 @@ class SwfAsset < ApplicationRecord
|
|||
|
||||
belongs_to :zone
|
||||
has_many :parent_swf_asset_relationships
|
||||
has_one :contribution, :as => :contributed, :inverse_of => :contributed
|
||||
has_many :parent_swf_asset_relationships
|
||||
|
||||
before_validation :normalize_manifest_url, if: :manifest_url?
|
||||
|
||||
delegate :depth, :to => :zone
|
||||
|
||||
scope :biology_assets, -> { where(:type => PetState::SwfAssetType) }
|
||||
scope :object_assets, -> { where(:type => Item::SwfAssetType) }
|
||||
|
||||
PARTITION_COUNT = 3
|
||||
PARTITION_DIGITS = 3
|
||||
PARTITION_ID_LENGTH = PARTITION_COUNT * PARTITION_DIGITS
|
||||
|
@ -42,16 +52,6 @@ class SwfAsset < ApplicationRecord
|
|||
"#{image_version}"
|
||||
end
|
||||
|
||||
attr_accessor :item
|
||||
|
||||
has_one :contribution, :as => :contributed, :inverse_of => :contributed
|
||||
has_many :parent_swf_asset_relationships
|
||||
|
||||
delegate :depth, :to => :zone
|
||||
|
||||
scope :biology_assets, -> { where(:type => PetState::SwfAssetType) }
|
||||
scope :object_assets, -> { where(:type => Item::SwfAssetType) }
|
||||
|
||||
# To manually change the body ID without triggering the usual change to 0,
|
||||
# use this override method.
|
||||
def override_body_id(new_body_id)
|
||||
|
|
Loading…
Reference in a new issue