class Event
scope :mybooking, ->(user_ids) { where(user_id: user_ids) }
end
Agora é possível fazer no controller:
reservations = [["2","3"], ["3","1"], ["6", "1"]]
Event.mybooking(reservations.map(&:first))
class Event
scope :mybooking, ->(user_ids) { where(user_id: user_ids) }
end
reservations = [["2","3"], ["3","1"], ["6", "1"]]
Event.mybooking(reservations.map(&:first))