debugging removed

master
Denis Knauf 2011-11-22 12:14:22 +01:00
parent 69aceef180
commit 63be31734b
3 changed files with 1 additions and 9 deletions

View File

@ -107,7 +107,6 @@ class SmqlToAR
# Model der Relation `rel` von `model`
def self.model_of model, rel
p model_of: rel.to_sym, model: model
r = model.reflections[ rel.to_sym].andand.klass
r.nil? && rel === :self ? model : r
end
@ -165,9 +164,7 @@ class SmqlToAR
def each
model = @model
p each: self, path: @path
@path.each do |rel|
p rel: rel
unless rel === :self
model = SmqlToAR.model_of model, rel
return false unless model

View File

@ -58,9 +58,7 @@ class SmqlToAR
conditions.each do |c|
raise_unless colop =~ /^(?:\d*:)?(.*?)((?:\W*(?!\])\W)?)$/, UnexpectedColOpError.new( model, colop, val)
col, op = $1, $2
p col: col, op: op
col = split_keys( col).collect {|c| Column.new model, c }
p col: col
r = c.try_parse model, col, op, val
break if r
end
@ -248,10 +246,9 @@ class SmqlToAR
model, *sub = sub
t = table + col.path + [col.col]
col.joins.each {|j, m| builder.joins table+j, m }
p build_t: t
builder.joins t, model
b2 = 1 == sub.length ? builder : Or.new( builder)
sub.each {|i| i.collect( &it.build( And.new( b2), t)); p 'or' => b2 }
sub.each {|i| i.collect( &it.build( And.new( b2), t)) }
end
self
end

View File

@ -90,7 +90,6 @@ class SmqlToAR
end
def build_join orig, pretable, table, prekey, key
p build_join: {orig: orig, pretable: pretable, table: table, prekey: prekey, key: key}, alias: @table_alias
" LEFT JOIN #{orig} AS #{quote_table_name table} ON #{column pretable, prekey} = #{column table, key} "
end
@ -105,7 +104,6 @@ class SmqlToAR
premodel = @table_model[ pretable]
t = @table_alias[ table]
pt = quote_table_name table[ 0...-1]
p table: table
refl = premodel.reflections[table.last.to_sym]
case refl
when ActiveRecord::Reflection::ThroughReflection