sferik/rails_admin — Issue #776: filtering on date causes problems
Author: jorgeramos
Created: 2011-10-13 21:17:56+00:00
State: open

Steps to reproduce:
1) go to the users index page on rails admin
2) Click add filter
3) Select "Created at" from the drop down
4) Select "Today" or "Yesterday" or any other option from the new drop down
5) Hit Refresh

After step 5 an exception is raised:
ActiveRecord::PreparedStatementInvalid in RailsAdmin::MainController#index

wrong number of bind variables (1 for 2) in: ((users.created_at BETWEEN ? AND ?))

Request Parameters:
{"utf8"=>"✓",
"authenticity_token"=>"o1zZVl5VwdDENY3Vmr656MKqbKbcMrDKvzGC9q9GYYU=",
"filters"=>{"created_at"=>{"1318540384267"=>{"operator"=>"yesterday",
"value"=>""}}},
"query"=>"",
"sort"=>"id",
"sort_reverse"=>"false",
"model_name"=>"users"}

--------------------

In addition to that, it would be great to specify an exact date from a calendar component