Module: Decidim::Core::HasEndorsableInputSort

Defined in:
app/types/decidim/core/has_endorsable_input_sort.rb

Class Method Summary collapse

Class Method Details

.included(child_class) ⇒ Object



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

def self.included(child_class)
  child_class.argument :endorsement_count,
                       type: String,
                       description: "Sort by number of endorsements, valid values are ASC or DESC",
                       required: false,
                       prepare: ->(value, _ctx) do
                                  { endorsements_count: value }
                                end
end