Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for Groupdate 4 #7

Closed
wants to merge 1 commit into from
Closed

Conversation

ankane
Copy link

@ankane ankane commented Nov 5, 2018

Hey @codesnik, this adds support for Groupdate 4 (and makes the existing tests pass). I use a similar approach in the ActiveMedian gem. https://github.com/ankane/active_median/blob/8d8313a35117643c60c317c54a0b831457cf0547/lib/active_median/model.rb#L54

Without this, calculate-all returns times instead of dates in keys. This also fills in missing data points.

@ankane
Copy link
Author

ankane commented Nov 5, 2018

And here's the process_result code: https://github.com/ankane/groupdate/blob/c74afce40d526cf849a364542ed89130d631a01a/lib/groupdate.rb#L19

It's essentially a no-op if Groupdate wasn't used.

@nicowenterodt
Copy link

nicowenterodt commented Aug 7, 2019

Thanks @ankane. This works pretty good!

So after testing your PR my code starts working again and the format -options isn't ignored anymore. 🎉

MyModel.group_by_week(:created_at, format: "%W").calculate_all(:average_something)

So I give my Thumbs-Up for merging this one @codesnik

@codesnik
Copy link
Owner

sorry, guys, I have no time and/or will to even review PR's to that little gem anymore. Maybe I should just pass ownership to someone else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants