Class: Gitlab::Pagination::Keyset::InOperatorOptimization::OrderByColumnData

Inherits:
ColumnData
  • Object
show all
Extended by:
Utils::Override
Defined in:
lib/gitlab/pagination/keyset/in_operator_optimization/order_by_column_data.rb

Instance Attribute Summary collapse

Attributes inherited from ColumnData

#arel_table, #as, #original_column_name

Instance Method Summary collapse

Methods included from Utils::Override

extended, extensions, included, method_added, override, prepended, queue_verification, verify!

Methods inherited from ColumnData

#arel_column_as, #array_aggregated_column, #array_aggregated_column_name, #projection

Constructor Details

#initialize(column, as, arel_table) ⇒ OrderByColumnData

column - a ColumnOrderDefinition object as - custom alias for the column arel_table - relation where the column is located


15
16
17
18
# File 'lib/gitlab/pagination/keyset/in_operator_optimization/order_by_column_data.rb', line 15

def initialize(column, as, arel_table)
  super(column.attribute_name.to_s, as, arel_table)
  @column = column
end

Instance Attribute Details

#columnObject (readonly)

Returns the value of attribute column.


10
11
12
# File 'lib/gitlab/pagination/keyset/in_operator_optimization/order_by_column_data.rb', line 10

def column
  @column
end

Instance Method Details

#arel_columnObject


21
22
23
# File 'lib/gitlab/pagination/keyset/in_operator_optimization/order_by_column_data.rb', line 21

def arel_column
  column.column_expression
end

#column_expressionObject


26
27
28
# File 'lib/gitlab/pagination/keyset/in_operator_optimization/order_by_column_data.rb', line 26

def column_expression
  arel_table[original_column_name]
end

#column_for_projectionObject


30
31
32
# File 'lib/gitlab/pagination/keyset/in_operator_optimization/order_by_column_data.rb', line 30

def column_for_projection
  column.column_expression.as(original_column_name)
end