Whenever I do:
Person.where(...)
I get a Criteria object. That’s understandable. But I couldn’t find how do I get access to actual models collection? For now, I have to do this workaround:
Person.where(...).map { |person| person }
And then query gets executed and I have an array of Person objects. Is there an easier method? #all doesn’t seem to work, it returns the same Criteria object.
Just convert the Criteria object to an array: