Class: Decidim::Core::BaseInputSort

Inherits:
GraphQL::Schema::InputObject
  • Object
show all
Defined in:
app/types/decidim/core/base_input_sort.rb

Instance Method Summary collapse

Instance Method Details

#prepareObject

Overwrite the prepare method to allow 2 possible values only



7
8
9
10
11
12
13
# File 'app/types/decidim/core/base_input_sort.rb', line 7

def prepare
  arguments.each do |key, value|
    next if key == "locale"
    raise GraphQL::ExecutionError, "Invalid order value for #{key}, only ASC or DESC are valids" unless valid_order?(value)
  end
  super
end