Module: Trax::Controller::Collection::Sortable::ClassMethods
- Defined in:
- lib/trax/controller/collection/sortable.rb
Instance Method Summary collapse
- #has_sort_scope(sort_scope_name, only: [:index, :search], type: :boolean, **options) ⇒ Object
- #has_sort_scopes(*names, **options) ⇒ Object
Instance Method Details
#has_sort_scope(sort_scope_name, only: [:index, :search], type: :boolean, **options) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/trax/controller/collection/sortable.rb', line 10 def has_sort_scope(sort_scope_name, only: [:index, :search], type: :boolean, **) SORT_DIRECTIONS.each do |dir| _sort_scope_name = :"#{sort_scope_name}_#{dir}" has_scope(_sort_scope_name, only: only, type: type, **) end end |
#has_sort_scopes(*names, **options) ⇒ Object
17 18 19 |
# File 'lib/trax/controller/collection/sortable.rb', line 17 def has_sort_scopes(*names, **) names.each{ |_name| has_sort_scope(_name, **) } end |