Hello, I have a model like this:
class Car < ActiveRecord::Base
def color©
where(“color = ?”,c)
end
end
Suppose that I want to show the red and blue cars. I could do
something like this:
@cars = Car.color(‘blue’) + Car.color(‘red’)
The problem I’m finding is that now, @cars is an array and I could not
do something like that:
@cars.page(params[:page]).per(10)
@cars.order( … )
or any method ActiveRecord implements. The question is: How can I
manage ActiveRecord array/collection for do: + - | &?
Thanks very much.