Skip to content

Instantly share code, notes, and snippets.

@nz
Created October 12, 2010 03:59
Show Gist options
  • Save nz/621642 to your computer and use it in GitHub Desktop.
Save nz/621642 to your computer and use it in GitHub Desktop.
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