Skip to content

monsterlabs/scope_by_fuzzy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

The scope_by_soundex gem provides a simple interface to use the set of functions of contrib/fuzzystringmatching for PostgreSQL.

How to install It

Edit your Gemfile and insert the next line:

gem "scope_by_soundex"

Then use the bundler to install It:

$ bundle install

Then execute the rails migration generator:

$ ./script/rails generate scope_by_soundex_install

And finally run the rails migrations to add the functions for PostgreSQL:

$ rake db:migrate

How to use It

# scope_by_soundex_matcher

class Person < ActiveRecord::Base
    scope_by_soundex_matcher :find_by_fullname, :fields => [:firstname, :lastname]
end

Person.find_by_fullname 'Alejandro' => Returns a collection of active_record objects

# scope_by_difference_matcher

class Person < ActiveRecord::Base
    scope_by_difference_matcher :find_by_fullname, :fields => [:firstname, :lastname]
end

Person.find_by_fullname 'Alejandro' => Returns a collection of active_record objects

Copyright © 2010 Alejandro Juarez. See LICENSE for details.

About

This gem provides the soundex and difference postgresql functions to determine similarities and distance between strings

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages