class Event
scope :mybooking, ->(user_ids) { where(user_id: user_ids) }
end
Nyní je možné provést v ovladači:
reservations = [["2","3"], ["3","1"], ["6", "1"]]
Event.mybooking(reservations.map(&:first))
class Event
scope :mybooking, ->(user_ids) { where(user_id: user_ids) }
end
Nyní je možné provést v ovladači:
reservations = [["2","3"], ["3","1"], ["6", "1"]]
Event.mybooking(reservations.map(&:first))