Wice Grid - How to customize a SQL-query?

22 views
Skip to first unread message

Quake Live

unread,
Oct 22, 2015, 6:00:03 AM10/22/15
to rubyonra...@googlegroups.com
Hello guys,

is it possible to "customize" filter specific SQL-queries? Maybe in the
wice_grid_config.rb ?

If so then tell me how please.

To mention the problem i have, here it comes:

I want to filter some records of a specific table, let say the name of
the table is clients.

The filter i want to use is the date->to filter.
The problem is that if I use it, let say for the date "02.04.2015" then
it will look for all dates "< 02.04.2015".

But i want it to be "<= 02.04.2015".

thx

Quaker!

--
Posted via http://www.ruby-forum.com/.

Colin Law

unread,
Oct 22, 2015, 7:06:21 AM10/22/15
to Ruby on Rails: Talk
On 22 October 2015 at 10:59, Quake Live <li...@ruby-forum.com> wrote:
> Hello guys,
>
> is it possible to "customize" filter specific SQL-queries? Maybe in the
> wice_grid_config.rb ?
>
> If so then tell me how please.
>
> To mention the problem i have, here it comes:
>
> I want to filter some records of a specific table, let say the name of
> the table is clients.
>
> The filter i want to use is the date->to filter.
> The problem is that if I use it, let say for the date "02.04.2015" then
> it will look for all dates "< 02.04.2015".
>
> But i want it to be "<= 02.04.2015".

I am assuming that the date is actually a datetime field, you should
be able to do
Client.where(date < some_date+1.day)
That also assumes that some_date is a Time set to the start of a day.
In addition you have to watch the timezones of course.

Colin
Reply all
Reply to author
Forward
0 new messages