Created
August 4, 2009 21:22
-
-
Save thoughtbot/161556 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
users = query.find(:cname => "thoughtbot") | |
</code></pre> | |
Now, what's tricky is that you could pass any syntax-changing value to that and you'd get the right SQL in the executed query. | |
<filter:code lang="ruby"> | |
query.find :cname => "thoughtbot" # => company.name = "thoughtbot" | |
query.find :cname => nil # => company.name IS NULL | |
query.find :cname => ["Google", "37 Signals"] # => company.name IN ("Google", "37 Signals") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment