I have three queries that match different yet related conditions.
Presently, I'm simply adding the results into one big collection, but
I'd like to combine them for less queries.

def available_at?(params)
  ...
  return false if
      (TableBooking.all(:at.lte => params[:at], :ending.gte => params
[:ending]) +
      TableBooking.all(:at.gte => params[:at], :at.lte => params
[:ending]) +
      TableBooking.all(:ending.gte => params[:at], :ending.lte =>
params[:ending])).count > 0
  true
end

Can I combine these queries?
-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en.


Reply via email to