Q:

Search Ruby on Rails Database for Key Value Pair

Hey all i'm getting hung up on how to search a database for a specific key pair.   What i'm doing is sending a combine array of objects that represent data not sent for that user for the day.   Here is the basic logic
Unless the database contains the object_id and user_id 
  insert it into the array
The association is many objects to many users. 
Is their a way to search the table cases_users so that it is a query like this
unless cases_users.contains? { object_id, user_id}
  objectarray.push(object_id)

A:

I think you want 
objectarray.push(object_id) unless User.find_by_object_id_and_user_id(object_id, user_id)

