Add find_by_name method to AltStyle

This commit is contained in:
Emi Matchu 2024-01-24 06:12:03 -08:00
parent e511bdc5e2
commit 40278afd0c

View file

@ -19,4 +19,11 @@ class AltStyle < ApplicationRecord
SwfAsset.from_biology_data(self.body_id, asset_data)
end
end
# For convenience in the console!
def self.find_by_name(color_name, species_name)
color = Color.find_by_name(color_name)
species = Species.find_by_name(species_name)
where(color_id: color, species_id: species).first
end
end