Created
August 11, 2012 00:55
-
-
Save laurens/3319579 to your computer and use it in GitHub Desktop.
This file contains 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
1.9.2p290 :007 > query = "foo" | |
=> "foo" | |
1.9.2p290 :008 > keyword_query = query and query.match(/\w/) and "#{query} AND " | |
=> "foo AND " | |
1.9.2p290 :009 > keyword_query | |
=> "foo" | |
1.9.2p290 :010 > full_query = "#{keyword_query}is_active:(true)" | |
=> "foois_active:(true)" | |
1.9.2p290 :011 > | |
1.9.2p290 :005 > keyword_query = (query and query.match(/\w/) and "#{query} AND ") | |
=> "foo AND " | |
1.9.2p290 :006 > full_query = "#{keyword_query}is_active:(true)" | |
=> "foo AND is_active:(true)" | |
1.9.2p290 :007 > |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment