I have an array of symbols, and I'd like to declare a scope in an ActiveRecord model for each one.
The following does not work:
@@animal_types = [:horse, :cat, :dog]
@@animal_types.each do |a|
scope a, :conditions => "animal_type = '#{a.to_s}'"
end
What would be the best way to achieve this?
Update: I was testing this incorrectly, this does in fact work