I have the following scope:
scope :task_based, ->(dept, number){ joins(:task).where('tasks.department = ? and tasks.number = ?', dept, number)}
Which works great, except occasionally I need to say something to the effect of where tasks.number is equal to 123 OR 456
I know ActiveRecord lets me do where(number: [123, 456]) but since this is a JOIN, that doesn't seem to work.
So how could I pass an array on that scope? It won't always be an array, but needs to account for when it is.