debugging-output removed
This commit is contained in:
parent
75c314159b
commit
09dfa782a8
|
@ -229,7 +229,6 @@ class SmqlToAR
|
|||
super( *pars)
|
||||
@value = Array.wrap @value
|
||||
cols = {}
|
||||
p self: self, cols: @cols
|
||||
@cols.each do |col|
|
||||
col_model = col.relation
|
||||
cols[col] = [col_model] + @value.collect {|val| ConditionTypes.try_parse( col_model, val) }
|
||||
|
@ -250,7 +249,6 @@ class SmqlToAR
|
|||
b2 = 1 == sub.length ? builder : Or.new( builder)
|
||||
sub.each {|i| i.collect( &it.build( And.new( b2), t)); p 'or' => b2 }
|
||||
end
|
||||
ap '=>' => builder
|
||||
self
|
||||
end
|
||||
end
|
||||
|
@ -336,7 +334,6 @@ class SmqlToAR
|
|||
|
||||
class <<self
|
||||
def try_parse model, func, args
|
||||
SmqlToAR.logger.info( { try_parse: [func,args]}.inspect)
|
||||
self.new model, func, args if self::Name === func and self::Expected.any?( &it === args)
|
||||
end
|
||||
|
||||
|
@ -404,7 +401,6 @@ class SmqlToAR
|
|||
end
|
||||
|
||||
def self.new model, col, val
|
||||
SmqlToAR.logger.info( { function: col.first.to_sym }.inspect)
|
||||
r = nil
|
||||
constants.each do |c|
|
||||
next if [:Function, :Where, :Expected, :Operator].include? c
|
||||
|
|
|
@ -142,13 +142,12 @@ class SmqlToAR
|
|||
end
|
||||
|
||||
def build_ar
|
||||
where_str = @_where.type_correction!.optimize!.tap {|x| p x }.build_where
|
||||
where_str = @_where.type_correction!.optimize!.build_where
|
||||
incls = {}
|
||||
@_includes.each do |inc|
|
||||
b = incls
|
||||
inc[1..-1].collect {|rel| b = b[rel] ||= {} }
|
||||
end
|
||||
@logger.info where: where_str, wobs: @_wobs
|
||||
@model = @model.
|
||||
select( @_select.join( ', ')).
|
||||
joins( @_joins).
|
||||
|
@ -182,7 +181,6 @@ class SmqlToAR
|
|||
delegate :wobs, :joins, :includes, :sub_joins, :vid, :quote_column_name, :quoter, :quote_table_name, :column, :to => :parent
|
||||
|
||||
def initialize parent, tmp = false
|
||||
p init: self, parent: parent
|
||||
@parent = parent
|
||||
@parent.where self unless @parend.nil? && tmp
|
||||
end
|
||||
|
@ -207,7 +205,6 @@ class SmqlToAR
|
|||
end
|
||||
|
||||
def optimize!
|
||||
p optimize: self
|
||||
ext = []
|
||||
collect! do |sub|
|
||||
sub = sub.optimize! if sub.kind_of? Array
|
||||
|
@ -220,8 +217,6 @@ class SmqlToAR
|
|||
sub
|
||||
end
|
||||
end.compact!
|
||||
p optimized: self
|
||||
p ext: ext
|
||||
push *ext
|
||||
self
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue