Skip to content

Commit

Permalink
Switch from using the instance method klass to the klass method for e…
Browse files Browse the repository at this point in the history
…dge rails. (#283)
  • Loading branch information
robinator authored Jun 5, 2024
1 parent 619eb06 commit 12993f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/groupdate/enumerable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 12993f2

Please sign in to comment.