binarylogic / searchlogic

Searchlogic provides object based searching, common named scopes, and other useful tools.
http://rdoc.info/projects/binarylogic/searchlogic
MIT License
1.39k stars 133 forks source link

release 2.4.24 broken - UnknownConditionError #113

Closed fuzziness closed 14 years ago

fuzziness commented 14 years ago

The condition 'description_like_before_type_cast' is not a valid condition, we could not find any scopes that match this. Extracted source (around line #16):

13:         <ul>
14:           <li>
15:             <span>
16:               <%= form.input :name_or_description_like, :label => 'articolo',
17:                 :label_html => {:class => 'desc'},
18:                 :hint => 'codice o descrizione',
19:                 :wrapper => false, :required => false %>

ghost commented 14 years ago

Are you sure you're using 2.4.24? I believe the latest release fixes this.

fuzziness commented 14 years ago

yepp... just tried to rolling back to 2.4.23 an all works fine (rails 2.3.8 - ruby 1.8.7)

frahugo commented 14 years ago

I have the same issue with 2.3.8 and 1.8.7 and reverting to 2.4.23 solved it.

adamcrown commented 14 years ago

I'm having the same problem. Rolling back to 2.4.23 does solve the problem.

The issue seems to be that Search.respond_to?() was added in 2.4.24 (SHA: 21770e980ea2f2e3304f1a5b99e81a0f382d5bc0) but the respond_to?() calls interpolate_or_conditions() which raises an UnknownConditionError rather than returning false when it's passed an invalid "or condition".

I was able to reproduce it in the console with User.search().or_condition?('foo_or_bar_like')

ghost commented 14 years ago

this is fixed in 2.4.26, thanks for the help