diff --git a/lib/groupdate/enumerable.rb b/lib/groupdate/enumerable.rb index 42022de2f..0afcf8658 100644 --- a/lib/groupdate/enumerable.rb +++ b/lib/groupdate/enumerable.rb @@ -5,7 +5,7 @@ module Enumerable raise ArgumentError, "wrong number of arguments (given #{args.size}, expected 0)" if args.any? Groupdate::Magic::Enumerable.group_by(self, period, options, &block) elsif respond_to?(:scoping) - scoping { @klass.group_by_period(period, *args, **options, &block) } + scoping { klass.group_by_period(period, *args, **options, &block) } else raise ArgumentError, "no block given" end @@ -19,7 +19,7 @@ def group_by_period(period, *args, **options, &block) Groupdate::Magic.validate_period(period, options.delete(:permit)) send("group_by_#{period}", **options, &block) else - scoping { @klass.group_by_period(period, *args, **options, &block) } + scoping { klass.group_by_period(period, *args, **options, &block) } end end end