Skip to content

Instantly share code, notes, and snippets.

@ddollar
Forked from brandon-beacher/gist:199769
Created October 2, 2009 14:06
Show Gist options
  • Save ddollar/199770 to your computer and use it in GitHub Desktop.
Save ddollar/199770 to your computer and use it in GitHub Desktop.
named_scope :matches, lambda { |value| {
:select => sanitize_sql(["addresses.*, match(value) against(? in boolean mode) as relevancy", wildcardize(value)]),
:conditions => ["match(value) against(? in boolean mode)", wildcardize(value)],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment