Add find_by_name method to AltStyle
This commit is contained in:
parent
e511bdc5e2
commit
40278afd0c
1 changed files with 7 additions and 0 deletions
|
@ -19,4 +19,11 @@ class AltStyle < ApplicationRecord
|
||||||
SwfAsset.from_biology_data(self.body_id, asset_data)
|
SwfAsset.from_biology_data(self.body_id, asset_data)
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|
Loading…
Reference in a new issue