Sha256: 6a02c33571bf13c1e0a5ecd57209e61b309930378a984d8197ef2e7078a37030
Contents?: true
Size: 558 Bytes
Versions: 14
Compression:
Stored size: 558 Bytes
Contents
# frozen_string_literal: true require_relative '../params/current_helper' require_relative './formatting_helper' module Sort module CurrentDirectionForHelper include Params::CurrentHelper include Sort::FormattingHelper def current_sort_direction_for(attribute, format: :short) direction = current_params.dig(:sort, attribute).to_s.downcase return ascending_str(format) if direction.presence_in %w[asc ascending] return descending_str(format) if direction.presence_in %w[desc descending] direction end end end
Version data entries
14 entries across 14 versions & 1 rubygems