app/models/named_variable_date.rb
# Build a sort join for a {ReferencesNamedVariableDates model that references this table}
# that allows its rows to be sorted based on the specific path.
#
# It returns a tuple that contains a reference to the join and two ordering expressions
# using said join that the calling query can include in its order statement.
#
# @param [Class] klass
# @param [String] path
# @param ["asc", "desc"] dir
# @return [(Arel::Nodes::OuterJoin, Arel::Nodes::Ordering, Arel::Nodes::Ordering)]
Build a sort join for a {ReferencesNamedVariableDates model that references this table}
that allows its rows to be sorted based on the specific path.

It returns a tuple that contains a reference to the join and two ordering expressions
using said join that the calling query can include in its order statement.
Build a sort join for a { ReferencesNamedVariableDates model that references this table } that allows its rows to be sorted based on the specific path . It returns a tuple that contains a reference to the join and two ordering expressions using said join that the calling query can include in its order statement .
def sort_join_for(klass, path, dir = "asc")
      raise "#{klass} does not reference NamedVariableDate" unless klass < ReferencesNamedVariableDates
      reflect_on_association(:entity).polymorphic_inverse_of klass
      name = sort_join_name_for klass, path
      table = arel_table.alias name
      on_condition = sort_join_on_condition_for table, klass, path
      join = Arel::Nodes::OuterJoin.new table, on_condition
      orderings = %i[value precision].map do |column|
        arel_apply_order_to table[column], dir, nulls: :last
      end
      [join, *orderings]
    end
def sort_join_for ( klass , path , dir = "asc" ) raise "#{klass} does not reference NamedVariableDate" unless klass < ReferencesNamedVariableDates reflect_on_association ( :entity ) . polymorphic_inverse_of klass name = sort_join_name_for klass , path table = arel_table . alias name on_condition = sort_join_on_condition_for table , klass , path join = Arel :: Nodes :: OuterJoin . new table , on_condition orderings = %i[ value precision ] . map do | column | arel_apply_order_to table [ column ] , dir , nulls : :last end [ join , * orderings ] end
Build a sort join for a {ReferencesNamedVariableDates model that references this table}
that allows its rows to be sorted based on the specific path.
Build a sort join for a { ReferencesNamedVariableDates model that references this table } that allows its rows to be sorted based on the specific path .
None
(Arel::Nodes::OuterJoin, Arel::Nodes::Ordering, Arel::Nodes::Ordering)
klass
path
dir
None