1
0
Fork 0
forked from OpenNeo/impress

Remove unused SwfAsset.fitting_standard_body_ids and support methods

This commit is contained in:
Emi Matchu 2024-02-24 15:16:25 -08:00
parent c25e015b70
commit 7fee4e6e41
2 changed files with 0 additions and 17 deletions

View file

@ -30,15 +30,6 @@ class PetType < ApplicationRecord
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 = []
# TODO: omg so lame :P

View file

@ -51,18 +51,10 @@ class SwfAsset < ApplicationRecord
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