Remove unused NC Mall spider code & fields

We haven't used the mall spider in this app in forever (I guess we even
deleted the code at some point?), but there was some vestigial stuff
left. Goodbye!
This commit is contained in:
Emi Matchu 2023-11-11 15:45:38 -08:00
parent 94d15f005d
commit c725a11920
4 changed files with 7 additions and 21 deletions

View file

@ -34,13 +34,6 @@ class Item < ApplicationRecord
order(arel_table[:created_at].desc) if arel_table[:created_at] order(arel_table[:created_at].desc) if arel_table[:created_at]
} }
scope :spidered_longest_ago, -> {
order(["(last_spidered IS NULL) DESC", "last_spidered DESC"])
}
scope :sold_in_mall, -> { where(:sold_in_mall => true) }
scope :not_sold_in_mall, -> { where(:sold_in_mall => false) }
scope :sitemap, -> { order([:id]).limit(49999) } scope :sitemap, -> { order([:id]).limit(49999) }
scope :with_closet_hangers, -> { joins(:closet_hangers) } scope :with_closet_hangers, -> { joins(:closet_hangers) }
@ -420,11 +413,6 @@ class Item < ApplicationRecord
}.merge(options)) }.merge(options))
end end
before_create do
self.sold_in_mall ||= false
true
end
def handle_assets! def handle_assets!
if @parent_swf_asset_relationships_to_update && @current_body_id if @parent_swf_asset_relationships_to_update && @current_body_id
new_swf_asset_ids = @parent_swf_asset_relationships_to_update.map(&:swf_asset_id) new_swf_asset_ids = @parent_swf_asset_relationships_to_update.map(&:swf_asset_id)

View file

@ -174,11 +174,6 @@ class SwfAsset < ApplicationRecord
self.manifest_url = data[:manifest] self.manifest_url = data[:manifest]
end end
def mall_data=(data)
self.zone_id = data['zone'].to_i
self.url = "https://images.neopets.com/#{data['url']}"
end
def normalize_manifest_url def normalize_manifest_url
parsed_manifest_url = Addressable::URI.parse(manifest_url) parsed_manifest_url = Addressable::URI.parse(manifest_url)
parsed_manifest_url.scheme = "https" parsed_manifest_url.scheme = "https"

View file

@ -0,0 +1,6 @@
class RemoveMallSpiderFieldsFromItem < ActiveRecord::Migration[7.1]
def change
remove_column :items, :sold_in_mall, default: false, null: false
remove_column :items, :last_spidered, precision: nil
end
end

View file

@ -10,7 +10,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.1].define(version: 2023_11_11_232015) do ActiveRecord::Schema[7.1].define(version: 2023_11_11_234255) do
create_table "auth_servers", id: :integer, charset: "latin1", force: :cascade do |t| create_table "auth_servers", id: :integer, charset: "latin1", force: :cascade do |t|
t.string "short_name", limit: 10, null: false t.string "short_name", limit: 10, null: false
t.string "name", limit: 40, null: false t.string "name", limit: 40, null: false
@ -137,15 +137,12 @@ ActiveRecord::Schema[7.1].define(version: 2023_11_11_232015) do
t.integer "price", limit: 3, null: false t.integer "price", limit: 3, null: false
t.integer "weight_lbs", limit: 2 t.integer "weight_lbs", limit: 2
t.text "species_support_ids", size: :medium t.text "species_support_ids", size: :medium
t.boolean "sold_in_mall", default: false, null: false
t.datetime "last_spidered", precision: nil
t.datetime "created_at", precision: nil t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil t.datetime "updated_at", precision: nil
t.boolean "explicitly_body_specific", default: false, null: false t.boolean "explicitly_body_specific", default: false, null: false
t.integer "manual_special_color_id" t.integer "manual_special_color_id"
t.column "modeling_status_hint", "enum('done','glitchy')" t.column "modeling_status_hint", "enum('done','glitchy')"
t.boolean "is_manually_nc", default: false, null: false t.boolean "is_manually_nc", default: false, null: false
t.index ["last_spidered"], name: "objects_last_spidered"
t.index ["modeling_status_hint", "created_at", "id"], name: "items_modeling_status_hint_and_created_at_and_id" t.index ["modeling_status_hint", "created_at", "id"], name: "items_modeling_status_hint_and_created_at_and_id"
t.index ["modeling_status_hint", "created_at"], name: "items_modeling_status_hint_and_created_at" t.index ["modeling_status_hint", "created_at"], name: "items_modeling_status_hint_and_created_at"
t.index ["modeling_status_hint", "id"], name: "items_modeling_status_hint_and_id" t.index ["modeling_status_hint", "id"], name: "items_modeling_status_hint_and_id"