Created
August 19, 2013 08:52
-
-
Save mashiro/6267009 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
| module WhereLikeExtension | |
| def where_like(opts, *rest) | |
| return self if opts.blank? | |
| spawn.where_like! opts, *rest | |
| end | |
| def where_like!(opts, *rest) | |
| self.where_values += build_where(opts, rest).map { |r| Arel::Nodes::Matches.new r.left, r.right } | |
| self | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment