I have an array of arrays like [[\"2\",\"3\"], [\"3\",\"1\"], [\"6\", \"1\"]]. The first element of each sub-array is the user ID and the second one is the number o
[[\"2\",\"3\"], [\"3\",\"1\"], [\"6\", \"1\"]]
class Event scope :mybooking, ->(user_ids) { where(user_id: user_ids) } end
Now it is possible to do in controller:
reservations = [["2","3"], ["3","1"], ["6", "1"]] Event.mybooking(reservations.map(&:first))