Created
October 12, 2010 03:59
-
-
Save nz/621642 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 < AR::Base | |
searchable do | |
string :tag_names, :multiple => true | |
end | |
def tag_names | |
tags.map(&:name) | |
end | |
end | |
# all docs tagged 'bar' | |
search = Foo.search do | |
with(:tag_names, 'bar') | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment