I was wondering whether it is possible to do "between" queries with the Ohm::Timestamps module.
For example, is it possible to do a query like this ActiveRecord query:
User.where(created_at: @date_start..@date_end)
Right now, I am just grabbing them all, sorting by created_at and iterating over the results using a select:
AnonymousVisitor.find(store_id: store_id).sort_by(:created_at).select do |visitor|
visitor.created_at >= date_start && visitor.created_at < date_end
end
But I imagine this will be an expensive operation. Is there a good way to do this?
I was wondering whether it is possible to do "between" queries with the Ohm::Timestamps module.
For example, is it possible to do a query like this ActiveRecord query:
Right now, I am just grabbing them all, sorting by created_at and iterating over the results using a select:
But I imagine this will be an expensive operation. Is there a good way to do this?