ernie/ransack — Issue #42: has ransack problems with particular characters?
Author: msan
Created: 2011-11-25 21:26:56+00:00
State: open

here is the situation.
I have a Company model with an attribute CLASSIFICATIONS = ["<= € 150.000,00"," > € 150.000,00 <= € 309.873,60"," > € 309.873,60 < € 500.000,00"].freeze.
In my seeds.rb I've put
a = ["<= € 150.000,00", "> € 150.000,00 <= € 309.873,60", "> € 150.000,00 <= € 309.873,60"]
for i in(1..100)
Company.create!(:name => "company-#{i}", :classification => a[rand(a.size)])

Then in the search form I've set:
= f.label :classification_eq, t('classification')
= f.select :classification_eq, Company::CLASSIFICATIONS, :include_blank => true

If I search for <= € 150.000,00 then is displayed a list of companies.
But if I search for > € 150.000,00 <= € 309.873,60 or > € 150.000,00 <= € 309.873,60 I have no list but there are companies with classification = <= € 309.873,60 or > € 150.000,00 <= € 309.873,60.