Class: SmqlToAR::ConditionTypes::Select
- Defined in:
- lib/smql_to_ar/condition_types.rb
Constant Summary collapse
- Operator =
''
- Expected =
[nil]
Constants inherited from Condition
Instance Attribute Summary
Attributes inherited from Condition
Instance Method Summary collapse
Methods inherited from Condition
#condition_build, #initialize, inspect, #inspect, try_parse, #verify, #verify_allowed
Methods included from Assertion
Constructor Details
This class inherits a constructor from SmqlToAR::ConditionTypes::Condition
Instance Method Details
#select_build(builder, table) ⇒ Object Also known as: build
383 384 385 386 387 388 389 390 391 392 393 394 |
# File 'lib/smql_to_ar/condition_types.rb', line 383 def select_build builder, table @cols.each do |col| if col.exist_in? col.joins builder, table builder.select table+col.to_a else col.joins {|j, m| builder.includes table+j } builder.includes table+col.to_a end end self end |
#verify_column(col) ⇒ Object
379 380 381 |
# File 'lib/smql_to_ar/condition_types.rb', line 379 def verify_column col raise_unless col.exist_in? || SmqlToAR.model_of( col.last_model, col.col), NonExistingSelectableError.new( col) end |