This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Fernando Luizao (author)
Mon Oct 19 15:39:52 -0700 2009
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | ||
| |
README | ||
| |
Rakefile | ||
| |
init.rb | ||
| |
install.rb | ||
| |
lib/ | ||
| |
tasks/ | ||
| |
test/ | ||
| |
uninstall.rb |
README
Insensitivity
==========
Insensitivity is a rails plugin that helps to do case and accent insensitive searches in PostgreSQL
It change the WHERE conditions to translate the field removing accents and applying lowercase
NOTE: I'm abandonning the *_search fields approach and making the plugin PostgreSQL specific.
If you want to use the old aproach, it is tagged as 0.0.1
Example
=======
Migration:
create_table :foos do |t|
t.string :field1
t.string :field2
end
Model:
class Foo < ActiveRecord::Base
insensible :field1, :field2
end
Foo.find_by_field1('bla')
SELECT * FROM foos
WHERE TRANSLATE(LOWER(widgets.field1),
'âãäåāăąèééêëēĕėęěìíîïìĩīĭóôõöōŏőùúûüũūŭůç',
'aaaaaaaeeeeeeeeeeiiiiiiiiooooooouuuuuuuuc') = 'bla'
Foo.find(:first, :conditions => ['field1 = ?', 'bla'], :order => 'field1')
SELECT * FROM foos
WHERE TRANSLATE(LOWER(widgets.field1),
'âãäåāăąèééêëēĕėęěìíîïìĩīĭóôõöōŏőùúûüũūŭůç',
'aaaaaaaeeeeeeeeeeiiiiiiiiooooooouuuuuuuuc') = 'bla'
ORDER BY field1 LIMIT 1
Copyright (c) 2009 Fernando Luizao, released under the MIT license








