I can't find an answer for this elsewhere, so I'm asking here:
How do I "SELECT COUNT
" with data_mapper?
What I've tried:
MyClass.count
MyClass.size
MyClass.all.count
MyClass.all.size
What does work is:
ids = []
MyClass.all.each do |class|
ids << class.id
end
ids.size
But that's a bit horrible. Anyone know any better way?