Skip to content

Instantly share code, notes, and snippets.

@jhsu
Created January 15, 2010 17:14
Show Gist options
  • Save jhsu/278221 to your computer and use it in GitHub Desktop.
Save jhsu/278221 to your computer and use it in GitHub Desktop.
def name_like(names)
names = names.gsub(/,/, ' ').split
results = self.search
names.map do |name|
results = results.search(:first_name_like_or_last_name_like_or_middle_name_like => name)
end
results
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment