Move SwfAsset#override_body_id to the bottom of the file

This is a console-y method, it's not important enough to be up here!
This commit is contained in:
Emi Matchu 2024-02-24 15:24:24 -08:00
parent cf1cdf7e7d
commit 829d960d70

View file

@ -52,13 +52,6 @@ class SwfAsset < ApplicationRecord
"#{image_version}" "#{image_version}"
end end
# To manually change the body ID without triggering the usual change to 0,
# use this override method.
def override_body_id(new_body_id)
@body_id_overridden = true
self.body_id = new_body_id
end
def as_json(options={}) def as_json(options={})
super({ super({
only: [:id, :known_glitches], only: [:id, :known_glitches],
@ -179,6 +172,13 @@ class SwfAsset < ApplicationRecord
self.manifest_url = parsed_manifest_url.to_s self.manifest_url = parsed_manifest_url.to_s
end end
# To manually change the body ID without triggering the usual change to 0,
# use this override method. (This is intended for use from the console.)
def override_body_id(new_body_id)
@body_id_overridden = true
self.body_id = new_body_id
end
def self.from_biology_data(body_id, data) def self.from_biology_data(body_id, data)
remote_id = data[:part_id].to_i remote_id = data[:part_id].to_i
swf_asset = SwfAsset.find_or_initialize_by type: 'biology', swf_asset = SwfAsset.find_or_initialize_by type: 'biology',