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

obscure check box issue #99

Closed masterkain closed 4 years ago

masterkain commented 14 years ago

Hello, I'm using searchlogic latest git + rails latest stable. I have one simple form with only two checkboxes that started throwing exceptions.

Digging further it turns out that if I disable searchlogic the form works normally, so I investigated a little bit and here are my findings:

Have a look at this rails line: http://github.com/rails/rails/blob/2-3-stable/actionpack/lib/action_view/helpers/form_helper.rb#L875

This method is called when building up a check box. Now I debugged a little and turns out that my object is correct, but when called send upon instead of querying the actual object it fires a SQL select.

So for example my object in this method is an instance of Profile, the method for send is 'autoplay'.

When searchlogic is disabled (i.e. no gem requirement, no plugin) it works, in the sense that it returns whetever autoplay attribute is set, but if searchlogic is enabled it tries to SELECT * FROM profiles WHERE (profiles.autoplay = 1)

masterkain commented 14 years ago

it should be noted that searchlogic 2.4.12 (latest version I had before upgrade) works.

icoretech commented 13 years ago

issue #83 probably related