-
-
Save pier-oliviert/7087208 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
class Foo | |
has_many :tags | |
has_many :states | |
# q is hash: { "tags" => "ruby", "states" => "open" } | |
def self.search(q) | |
# wat do? | |
end | |
end | |
# search should return a relation that scopes everything to the terms | |
# the values 'ruby' and 'open' are in the 'name' attribute of the Tag and State model. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment