diff --git a/app/models/item.rb b/app/models/item.rb index 8e8aae06..c5d3e43c 100644 --- a/app/models/item.rb +++ b/app/models/item.rb @@ -34,13 +34,6 @@ class Item < ApplicationRecord 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 :with_closet_hangers, -> { joins(:closet_hangers) } @@ -420,11 +413,6 @@ class Item < ApplicationRecord }.merge(options)) end - before_create do - self.sold_in_mall ||= false - true - end - def handle_assets! if @parent_swf_asset_relationships_to_update && @current_body_id new_swf_asset_ids = @parent_swf_asset_relationships_to_update.map(&:swf_asset_id) diff --git a/app/models/swf_asset.rb b/app/models/swf_asset.rb index 67af14a6..b072dac3 100644 --- a/app/models/swf_asset.rb +++ b/app/models/swf_asset.rb @@ -174,11 +174,6 @@ class SwfAsset < ApplicationRecord self.manifest_url = data[:manifest] 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 parsed_manifest_url = Addressable::URI.parse(manifest_url) parsed_manifest_url.scheme = "https" diff --git a/db/migrate/20231111234255_remove_mall_spider_fields_from_item.rb b/db/migrate/20231111234255_remove_mall_spider_fields_from_item.rb new file mode 100644 index 00000000..4e9e711f --- /dev/null +++ b/db/migrate/20231111234255_remove_mall_spider_fields_from_item.rb @@ -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 diff --git a/db/schema.rb b/db/schema.rb index 60ff6855..036b70e6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # 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| t.string "short_name", limit: 10, 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 "weight_lbs", limit: 2 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 "updated_at", precision: nil t.boolean "explicitly_body_specific", default: false, null: false t.integer "manual_special_color_id" t.column "modeling_status_hint", "enum('done','glitchy')" 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"], name: "items_modeling_status_hint_and_created_at" t.index ["modeling_status_hint", "id"], name: "items_modeling_status_hint_and_id"