diff options
Diffstat (limited to 'lib/arel')
-rw-r--r-- | lib/arel/factory_methods.rb | 4 | ||||
-rw-r--r-- | lib/arel/nodes/inner_join.rb | 4 | ||||
-rw-r--r-- | lib/arel/nodes/select_statement.rb | 1 | ||||
-rw-r--r-- | lib/arel/visitors/to_sql.rb | 2 |
4 files changed, 8 insertions, 3 deletions
diff --git a/lib/arel/factory_methods.rb b/lib/arel/factory_methods.rb index 85862c24c1..4899adfdc8 100644 --- a/lib/arel/factory_methods.rb +++ b/lib/arel/factory_methods.rb @@ -6,8 +6,8 @@ module Arel klass.new(to, constraint) end - def create_string_join from, to - create_join from, to, Nodes::StringJoin + def create_string_join to + create_join to, nil, Nodes::StringJoin end def create_and clauses diff --git a/lib/arel/nodes/inner_join.rb b/lib/arel/nodes/inner_join.rb index bf10eeac18..d09d9e819b 100644 --- a/lib/arel/nodes/inner_join.rb +++ b/lib/arel/nodes/inner_join.rb @@ -1,6 +1,10 @@ module Arel module Nodes class InnerJoin < Arel::Nodes::Join + def initialize left, right + raise if right == Arel::Nodes::StringJoin + super + end end end end diff --git a/lib/arel/nodes/select_statement.rb b/lib/arel/nodes/select_statement.rb index 6881a66747..c9a0cde4e0 100644 --- a/lib/arel/nodes/select_statement.rb +++ b/lib/arel/nodes/select_statement.rb @@ -5,6 +5,7 @@ module Arel attr_accessor :limit, :orders, :lock, :offset def initialize cores = [SelectCore.new] + #puts caller @cores = cores @orders = [] @limit = nil diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index b83bf2f6e7..8ceb839a6b 100644 --- a/lib/arel/visitors/to_sql.rb +++ b/lib/arel/visitors/to_sql.rb @@ -228,7 +228,7 @@ module Arel end def visit_Arel_Nodes_StringJoin o - "#{visit o.left} #{visit o.right}" + visit o.left end def visit_Arel_Nodes_OuterJoin o |