Skip to content

Instantly share code, notes, and snippets.

@hardbap
Created November 22, 2011 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hardbap/1385894 to your computer and use it in GitHub Desktop.
Save hardbap/1385894 to your computer and use it in GitHub Desktop.
query = MyModel.where("id = :id", :id => 21)
query = query.merge(MyModel.some_scope)
MyModel.connection.select_all(query.to_sql)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment