class Event
scope :mybooking, ->(user_ids) { where(user_id: user_ids) }
end
Nu er det muligt at gøre i 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
Nu er det muligt at gøre i controller:
reservations = [["2","3"], ["3","1"], ["6", "1"]]
Event.mybooking(reservations.map(&:first))