ankane/groupdate — pull request #54 by trestrantham (2014-07-17 03:27:43+00:00)
Title: Add ability to carry forward values from previous intervals

Adds the `carry_forward` option to `Groupdate::Magic` to allow values to be carried forward from previous intervals when missing.

So this:

```ruby
User.group_by_month(:created_at).sum(:posts)
=> {Sun, 01 Dec 2013 00:00:00 EST -05:00=>1,
Wed, 01 Jan 2014 00:00:00 EST -05:00=>3,
Sat, 01 Feb 2014 00:00:00 EST -05:00=>0,
Sat, 01 Mar 2014 00:00:00 EST -05:00=>0,
Tue, 01 Apr 2014 00:00:00 EDT -04:00=>5,
Thu, 01 May 2014 00:00:00 EDT -04:00=>0,
Sun, 01 Jun 2014 00:00:00 EDT -04:00=>25}
```
Changes to this:
```ruby
User.group_by_month(:created_at, carry_forward: true).sum(:posts)
=> {Sun, 01 Dec 2013 00:00:00 EST -05:00=>1,
Wed, 01 Jan 2014 00:00:00 EST -05:00=>3,
Sat, 01 Feb 2014 00:00:00 EST -05:00=>3,
Sat, 01 Mar 2014 00:00:00 EST -05:00=>3,
Tue, 01 Apr 2014 00:00:00 EDT -04:00=>5,
Thu, 01 May 2014 00:00:00 EDT -04:00=>5,
Sun, 01 Jun 2014 00:00:00 EDT -04:00=>25}
```