impress/app/models/color.rb
2010-11-27 18:41:06 -05:00

15 lines
385 B
Ruby

class Color < PetAttribute
fetch_objects!
Basic = %w(blue green red yellow).map { |name| find_by_name(name) }
BasicIds = Basic.map(&:id)
def self.basic_ids
BasicIds
end
def self.nonstandard_ids
@nonstandard_ids ||= File.read(Rails.root.join('config', 'nonstandard_colors.txt')).
chomp.split("\n").map { |name| Color.find_by_name(name).id }
end
end