diff --git a/lib/smql_to_ar.rb b/lib/smql_to_ar.rb index 1eedbd6..fdf32e9 100644 --- a/lib/smql_to_ar.rb +++ b/lib/smql_to_ar.rb @@ -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 diff --git a/lib/smql_to_ar/condition_types.rb b/lib/smql_to_ar/condition_types.rb index d91b86a..7349a10 100644 --- a/lib/smql_to_ar/condition_types.rb +++ b/lib/smql_to_ar/condition_types.rb @@ -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 diff --git a/lib/smql_to_ar/query_builder.rb b/lib/smql_to_ar/query_builder.rb index 76a6f8f..d6db390 100644 --- a/lib/smql_to_ar/query_builder.rb +++ b/lib/smql_to_ar/query_builder.rb @@ -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