Module: Helpers::Base

Includes:
Pagy::Backend, Pagy::Frontend
Defined in:
app/helpers/concerns/helpers/base.rb

Instance Method Summary collapse

Instance Method Details

#has_order?(scope) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
8
# File 'app/helpers/concerns/helpers/base.rb', line 5

def has_order?(scope)
  # This scope has an order if the SQL changes when we remove any order clause.
  scope.to_sql != scope.reorder("").to_sql
end