This gem provides the soundex and difference postgresql functions to determine similarities and distance between strings
Ruby
Switch branches/tags
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
.document
.gitignore
LICENSE
README.rdoc
Rakefile
VERSION
init.rb
scope_by_fuzzy.gemspec

README.rdoc

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

Copyright © 2010 Alejandro Juarez. See LICENSE for details.