Okay admittedly that title wasn't the best, but I don't know how else to ask this...
I'm using the Sequel gem with Postgres. I have a database with Playlists and Tracks, and I've filtered the Tracks by a specific attribute (so, I have a subset of the tracks).
I'm then using
Playlists.where(tracks: filtered_tracks) to filter the playlists down to the ones that contain the subset of tracks.
However, is it possible to only select playlists that have two or more Tracks from the subset of tracks? Say, something like
Playlists.where(tracks: filtered_tracks, at_least: 2).