2010-05-16 12:44:32 -07:00
|
|
|
class Species < PetAttribute
|
|
|
|
fetch_objects!
|
2010-06-22 09:42:25 -07:00
|
|
|
|
|
|
|
def self.require_by_name(name)
|
|
|
|
species = Species.find_by_name(name)
|
2010-11-18 20:25:34 -08:00
|
|
|
raise NotFound, "Species \"#{name.humanize}\" does not exist" unless species
|
2010-06-22 09:42:25 -07:00
|
|
|
species
|
|
|
|
end
|
2010-11-18 20:25:34 -08:00
|
|
|
|
|
|
|
class NotFound < ArgumentError;end
|
2010-05-15 08:38:45 -07:00
|
|
|
end
|