class Event
scope :mybooking, ->(user_ids) { where(user_id: user_ids) }
end
Nu is het mogelijk om in de controller te doen:
reservations = [["2","3"], ["3","1"], ["6", "1"]]
Event.mybooking(reservations.map(&:first))
class Event
scope :mybooking, ->(user_ids) { where(user_id: user_ids) }
end
Nu is het mogelijk om in de controller te doen:
reservations = [["2","3"], ["3","1"], ["6", "1"]]
Event.mybooking(reservations.map(&:first))