In Rails 4/Ruby 2.1, I'm trying to do something like this:
@user.submissions.where(:submission_codes_array => valid_submission_codes_array).count
Sort of similar to when you want to see if the :id
if within an array of possible values (i.e. .where(:id => valid_ids)
, except in this case checking if a particular attribute (which is a postgres array type) includes ANY values that are within the set of possible values, in which case it is then counted.
Any ideas?