I have a existing rails query but it doesn't work with mongoid .I need to convert so that it works with mongoid
Here is the query
scope :between, -> (sender_id,recipient_id) do
where("(conversations.sender_id = ? AND conversations.recipient_id =?) OR (conversations.sender_id = ? AND conversations.recipient_id =?)", sender_id,recipient_id, recipient_id, sender_id)
end
I am new to mongoid I tried but was not able to find suitable solution
Mongoid 3.4.2
Rails 5.0.1
ruby '2.3.0'