From 12993f235e101ea50d4d0e0a5f5325528cdad770 Mon Sep 17 00:00:00 2001 From: Rob Law Date: Tue, 4 Jun 2024 21:07:53 -0400 Subject: [PATCH] Switch from using the instance method klass to the klass method for edge rails. (#283) --- lib/groupdate/enumerable.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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