You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First off, thanks for an amazing gem, and even more thanks for your work on group_by_duration - it's just what I needed for a project of mine!
I've come across an issue - if you try to use last: with group_by_duration, the following error is thrown:
TypeError: <number> is not a symbol nor a string
[..]/groupdate/lib/groupdate/series_builder.rb:154:in `respond_to?'
[..]/groupdate/lib/groupdate/series_builder.rb:154:in `time_range'
[..]/groupdate/lib/groupdate/magic.rb:74:in `time_range'
[..]/groupdate/lib/groupdate/magic.rb:175:in `generate_relation'
[..]/groupdate/lib/groupdate/query_methods.rb:20:in `group_by_duration'
[..]/groupdate/lib/groupdate/enumerable.rb:33:in `block in group_by_duration'
[..]/gems/activerecord-6.0.2.1/lib/active_record/relation.rb:398:in `block in scoping'
[..]/gems/activerecord-6.0.2.1/lib/active_record/relation.rb:773:in `_scoping'
[..]/gems/activerecord-6.0.2.1/lib/active_record/relation.rb:398:in `scoping'
[..]/gems/activerecord-6.0.2.1/lib/active_record/associations/collection_proxy.rb:1101:in `scoping'
[..]/groupdate/lib/groupdate/enumerable.rb:33:in `group_by_duration'
First off, thanks for an amazing gem, and even more thanks for your work on
group_by_duration
- it's just what I needed for a project of mine!I've come across an issue - if you try to use
last:
withgroup_by_duration
, the following error is thrown:Using, e.g. the following code:
The problem is that
time_range
doesn't check if the period is an Integer (as is the case when grouping by duration) whenoptions[:last]
is provided.Some code was added to handle this case in
generate_series
. Adding the same code totime_range
solves the problem. PR coming.The text was updated successfully, but these errors were encountered: