Problem with Ruby Gem Chartkick

2

After switching to daylight saving time, I'm encountering a problem with Gem Chartkick .

I put my query as follows:

Ticket.unscoped.where('created_at >= ? ', Time.now - 10.days).group_by_day(:created_at).count

The result returned was:

  

{Mon, 20 Oct 2014 00:00:00 BRST -02: 00 => 7, Tue, 21 Oct 2014 00:00:00   BRST -02: 00 => 9, Wed, 22 Oct 2014 00:00:00 BRST -02: 00 => 6, Thu, Oct 23   2014 00:00:00 BRST -02: 00 = > 5, Fri, 24 Oct 2014 00:00:00 BRST   -02: 00 => 6, Sat, 25 Oct 2014 00:00:00 BRST -02: 00 => Sun, 26 Oct 2014 00:00:00 BRST -02: 00 => 0, Mon , Oct. 27, 2014 00:00:00 BRST -02: 00 = > 2,   Tue, Oct 28, 2014 00:00:00 BRST -02: 00 = > 1}

The generated graph is as follows:

The data is returning correctly, the problem seems to me that it is the graph that even receiving the correct data displays everything reset.

    
asked by anonymous 28.10.2014 / 18:09

1 answer

2

1) First use the series: false option; More info: link

2) The correct one is to use Time.zone.now instead of Time.now ; More info: link

It would look like this:

Ticket.unscoped.where('created_at >= ? ', Time.zone.now - 10.days).group_by_day(:created_at, series: false).count
    
07.11.2014 / 19:54