Created
August 28, 2014 20:04
-
-
Save coleww/45e4660b80675c59d084 to your computer and use it in GitHub Desktop.
i hate refinery so much
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
config.to_prepare do | |
module ActiveRecord | |
class Relation | |
def with_query(query='') | |
self.merge(self.class.name.split("::")[0...-1].join("::").constantize.search_by_title(query)) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment