Class: Decidim::Core::BaseInputSort
- Inherits:
-
GraphQL::Schema::InputObject
- Object
- GraphQL::Schema::InputObject
- Decidim::Core::BaseInputSort
- Defined in:
- lib/decidim/api/input_sorts/base_input_sort.rb
Direct Known Subclasses
ComponentInputSort, ParticipatorySpaceInputSort, UserEntityInputSort
Instance Method Summary collapse
-
#prepare ⇒ Object
Overwrite the prepare method to allow 2 possible values only.
Instance Method Details
#prepare ⇒ Object
Overwrite the prepare method to allow 2 possible values only
7 8 9 10 11 12 13 14 |
# File 'lib/decidim/api/input_sorts/base_input_sort.rb', line 7 def prepare arguments.each do |key, value| next if key.to_s == "locale" next if value.respond_to?(:call) raise GraphQL::ExecutionError, "Invalid order value for #{key.inspect}, only ASC or DESC are valids (received #{value.inspect})" unless valid_order?(value) end super end |