My model has this scope
scope :supported, order("name").collect {|m| m.name}.join(", ")
and it throws an error
NoMethodError: undefined method `includes_values' for "blah, blahblah":String
I'm thinking that it's because I'm trying to return a string as an ActiveRecord object, thoughts on how to fix it? Actually I have this code already working in the view but thought it might be better in the model, maybe not?
EDIT Moving it into a non-scope class method works
def supported
order("name").collect {|m| m.name}.join(", ")
end
Here's a related question that better clarifies the difference between scope
vs. self
class methods.