From 7fee4e6e41ae8a07db5713094e8074696ff9e7e5 Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Sat, 24 Feb 2024 15:16:25 -0800 Subject: [PATCH] Remove unused `SwfAsset.fitting_standard_body_ids` and support methods --- app/models/pet_type.rb | 9 --------- app/models/swf_asset.rb | 8 -------- 2 files changed, 17 deletions(-) diff --git a/app/models/pet_type.rb b/app/models/pet_type.rb index 2353cf4a..361b05f2 100644 --- a/app/models/pet_type.rb +++ b/app/models/pet_type.rb @@ -29,15 +29,6 @@ class PetType < ApplicationRecord color_ids = special_color ? [special_color.id] : Color.basic.select([:id]).map(&:id) where(color_id: color_ids) end - - def self.standard_body_ids - [].tap do |body_ids| - # TODO: the nil hack is lame :P - special_color_or_basic(nil).group_by(&:species_id).each do |species_id, pet_types| - body_ids.concat(pet_types.map(&:body_id)) - end - end - end def self.random_basic_per_species(species_ids) random_pet_types = [] diff --git a/app/models/swf_asset.rb b/app/models/swf_asset.rb index c47c5289..56572864 100644 --- a/app/models/swf_asset.rb +++ b/app/models/swf_asset.rb @@ -50,19 +50,11 @@ class SwfAsset < ApplicationRecord has_many :parent_swf_asset_relationships delegate :depth, :to => :zone - - def self.body_ids_fitting_standard - @body_ids_fitting_standard ||= PetType.standard_body_ids + [0] - end scope :fitting_body_id, ->(body_id) { where(arel_table[:body_id].in([body_id, 0])) } - scope :fitting_standard_body_ids, -> { - where(arel_table[:body_id].in(body_ids_fitting_standard)) - } - scope :fitting_color, ->(color) { body_ids = PetType.select(:body_id).where(:color_id => color.id).map(&:body_id) body_ids << 0