Pagy::VariableError in ReceivablesController#index
expected :period to be a an Array of min and max local Time instances; got [2022-12-30 00:00:00 -0300, 2022-12-29 00:00:00 -0300]
Steps to reproduce:
- Create an account receivable;
- Create an account receivable whose date is before the first one from step 1.
- Go to receivable index page.
Also reproducible when it updates the last account receivable create with a date before the first receivable created.
From the exception on the pagy gem:
raise VariableError.new(self, :period, 'to be a an Array of min and max local Time instances', @vars[:period]) \
unless @starting.is_a?(Time) && @ending.is_a?(Time) && !@starting.utc? && !@ending.utc? && @starting <= @ending
Thus, @starting date must be less than or equal to @ending date

Pagy::VariableError in ReceivablesController#index
expected :period to be a an Array of min and max local Time instances; got [2022-12-30 00:00:00 -0300, 2022-12-29 00:00:00 -0300]
Steps to reproduce:
Also reproducible when it updates the last account receivable create with a date before the first receivable created.
From the exception on the pagy gem:
Thus,
@startingdate must be less than or equal to@endingdate