searchlogic icon indicating copy to clipboard operation
searchlogic copied to clipboard

date_select not working

Open schugabe opened this issue 14 years ago • 9 comments

I found some old issues, concerning the date_select helper. It looks like there should be support to use this helper in combination with searchlogic.

But when I use <%= f.date_select :start_after, :include_blank => true %> it fails with "The is not a valid condition. You may only use conditions that map to a named scope"

schugabe avatar Nov 21 '09 23:11 schugabe

I have also encountered this issue. It looks like the dynamic finder is looking to match the individual date parts rather than the whole date...
undefined method `created_at_after(1i)='

philrosenstein avatar Dec 07 '09 16:12 philrosenstein

same probleme here :

The is not a valid condition. You may only use conditions that map to a named scope

kpitn avatar Dec 15 '09 09:12 kpitn

I have encountered this issue as well. This is really a fundemental requirement in an application I am currently writing. I am a big fan of Searchlogic because it helps keep my code very clean and I'd hate to need to use something else in order to solve this problem.

codehugger avatar Dec 18 '09 13:12 codehugger

I have write a quick/dirty solution to handle date_select : make a file /config/initializer/searchlogic.rb

http://gist.github.com/259508

kpitn avatar Dec 18 '09 14:12 kpitn

Here's another version that also handles datetime_select:

http://gist.github.com/312833

rubysolo avatar Feb 23 '10 23:02 rubysolo

Very good patch, you can fork the source and ask for a merge? I temporary just unpack the gem and patch it myself there.

goodwill avatar Mar 01 '10 05:03 goodwill

I forked and made the change in the gist. Seems to work well, but my pull request has gone unanswered http://github.com/philrosenstein/searchlogic

philrosenstein avatar Apr 20 '10 19:04 philrosenstein

I also have a fork with this change : http://github.com/rubysolo/searchlogic

rubysolo avatar Apr 22 '10 03:04 rubysolo

Same problem. I will utilize yours patchs. Tnks.

luizcarvalho avatar Jul 12 '11 14:07 luizcarvalho