Exception: Jsonapi::QueryBuilder::Errors::UnpermittedSortParameters

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/jsonapi/query_builder/errors/unpermitted_sort_parameters.rb

Instance Method Summary collapse

Constructor Details

#initialize(unpermitted_parameters) ⇒ UnpermittedSortParameters

Returns a new instance of UnpermittedSortParameters.



7
8
9
10
11
12
13
# File 'lib/jsonapi/query_builder/errors/unpermitted_sort_parameters.rb', line 7

def initialize(unpermitted_parameters)
  super [
    unpermitted_parameters.to_sentence,
    unpermitted_parameters.count == 1 ? "is not a" : "are not",
    "permitted sort attribute".pluralize(unpermitted_parameters.count)
  ].join(" ")
end