Skip to content

Instantly share code, notes, and snippets.

@roy
Created February 17, 2011 09:08
Show Gist options
  • Save roy/831352 to your computer and use it in GitHub Desktop.
Save roy/831352 to your computer and use it in GitHub Desktop.
how to chain these scopes with or
# rails3 + meta_where
name_relation = Article.where(:title >> "name")
name2_relation = Article.where(:title >> "name2")
# how to get an sql query like: "select * from articles where (title = 'name') or (title = 'name2')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment