Remove some unused PetType scopes
I looked at this and was like. "ok literally what is `nonstandard_colors` trying to do" reading it again now, I'm realizing the idea is that it probably runs two queries: one to get nonstandard colors, then depends on ActiveRecord to implicitly convert the relation to an array and then to IDs for the second query? Instead of doing a join?? Idk, it's unused, so trash it!
This commit is contained in:
parent
15a905b0dd
commit
6515e525fb
1 changed files with 0 additions and 6 deletions
|
@ -17,12 +17,6 @@ class PetType < ApplicationRecord
|
||||||
|
|
||||||
BasicHashes = YAML::load_file(Rails.root.join('config', 'basic_type_hashes.yml'))
|
BasicHashes = YAML::load_file(Rails.root.join('config', 'basic_type_hashes.yml'))
|
||||||
|
|
||||||
# Returns all pet types of a single standard color. The caller shouldn't care
|
|
||||||
# which, though, in this implemention, it's always Blue. Don't depend on that.
|
|
||||||
scope :single_standard_color, -> { where(:color_id => Color.basic.first) }
|
|
||||||
|
|
||||||
scope :nonstandard_colors, -> { where(:color_id => Color.nonstandard) }
|
|
||||||
|
|
||||||
scope :matching_name, ->(color_name, species_name) {
|
scope :matching_name, ->(color_name, species_name) {
|
||||||
color = Color.find_by_name!(color_name)
|
color = Color.find_by_name!(color_name)
|
||||||
species = Species.find_by_name!(species_name)
|
species = Species.find_by_name!(species_name)
|
||||||
|
|
Loading…
Reference in a new issue