Class: Decidim::Core::ComponentInputSort
- Inherits:
-
BaseInputSort
- Object
- GraphQL::Schema::InputObject
- BaseInputSort
- Decidim::Core::ComponentInputSort
- Includes:
- HasLocalizedInputSort
- Defined in:
- decidim-core/lib/decidim/api/input_sorts/component_input_sort.rb
Class Method Summary collapse
Methods included from HasLocalizedInputSort
Methods inherited from BaseInputSort
Class Method Details
.prepared_name(direction, ctx) ⇒ Object
25 26 27 28 29 30 31 |
# File 'decidim-core/lib/decidim/api/input_sorts/component_input_sort.rb', line 25 def self.prepared_name(direction, ctx) lambda do |locale| locale = ctx[:current_organization].default_locale if locale.blank? field = Arel::Nodes::InfixOperation.new("->", Arel.sql("name"), Arel::Nodes.build_quoted(locale)) Arel::Nodes::InfixOperation.new("", field, Arel.sql(direction.upcase)) end end |