ruby on rails - Using find method to find NOT matching -


I'm trying to see a user by group_id, my method looks like this:

  User.find (: all ,: conditions = & gt; {: group_id = & gt; '90a39597a1aa3ec65fccf29ae05d9b6aefbfea6b',: id = & gt;; current_user.id})  

: ID status does not make sense because I do not know the syntax for this part. How do I search the user by group_id and id that does not match current_user?

Hope this will be prudent.

Use the array / string variation options of the conditions:

  User.all (: conditions = & gt; ["group_id =? And id! =?", "90a39597a1aa3ec65fccf29ae05d9b6aefbfea6b", current_user.id])  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -