class Babik::Selection::Path::LocalPath
Local path
Constants
- OPERATOR_SEPARATOR
Attributes
model[R]
operator[R]
secondary_operator[R]
selected_field[R]
selection_path[R]
Public Class Methods
new(model, selection_path)
click to toggle source
Construct a local field path @param model [ActiveRecord::Base] model whose field will be used. @param selection_path
[String] selection path. Of the form <field>__<operator>. e.g. first_name__equal, stars__gt
If no operator is given (first_name), 'equal' will be used.
# File lib/babik/queryset/lib/selection/path/local_path.rb, line 19 def initialize(model, selection_path) @model = model @selection_path = selection_path.dup @selected_field, @operator, @secondary_operator = @selection_path.to_s.split(OPERATOR_SEPARATOR) # By default, if no operator is given, 'equal' will be used @operator ||= 'equal' end
Public Instance Methods
left_joins_by_alias()
click to toggle source
A local selection has no related left joins @return [Hash] Empty hash.
# File lib/babik/queryset/lib/selection/path/local_path.rb, line 37 def left_joins_by_alias {} end
target_alias()
click to toggle source
Return the target table alias. That is alias of the model table. For the moment, actually, return the name of this model's table. @return [String] alias of the model table.
# File lib/babik/queryset/lib/selection/path/local_path.rb, line 31 def target_alias @model.table_name end