remove warnings on each environment boot about modifying StandardBodyIds
This commit is contained in:
parent
9057f56e2e
commit
27f3111b65
1 changed files with 4 additions and 3 deletions
|
@ -12,9 +12,10 @@ class PetType < ActiveRecord::Base
|
|||
BasicHashes = YAML::load_file(Rails.root.join('config', 'basic_type_hashes.yml'))
|
||||
|
||||
StandardPetTypesBySpeciesId = PetType.where(arel_table[:color_id].in(Color::BasicIds)).group_by(&:species_id)
|
||||
StandardBodyIds = []
|
||||
StandardBodyIds = [].tap do |body_ids|
|
||||
StandardPetTypesBySpeciesId.each do |species_id, pet_types|
|
||||
StandardBodyIds += pet_types.map(&:body_id)
|
||||
body_ids.concat(pet_types.map(&:body_id))
|
||||
end
|
||||
end
|
||||
|
||||
# Returns all pet types of a single standard color. The caller shouldn't care
|
||||
|
|
Loading…
Reference in a new issue