Skip to content

Instantly share code, notes, and snippets.

@brandon-beacher
Created October 2, 2009 14:05
Show Gist options
  • Save brandon-beacher/199769 to your computer and use it in GitHub Desktop.
Save brandon-beacher/199769 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