diff options
author | Paul Sadauskas <psadauskas@gmail.com> | 2011-01-21 17:54:58 -0700 |
---|---|---|
committer | Paul Sadauskas <psadauskas@gmail.com> | 2011-01-21 17:54:58 -0700 |
commit | f0fe5e30dab40c500186d5901f3502796dca0d2c (patch) | |
tree | 581c89b70fa9b0b6ce722db33ec10d310cceebe8 /lib/arel | |
parent | 430d88b37632a3c91dd6c02eb2b19863207d1cae (diff) | |
download | rails-f0fe5e30dab40c500186d5901f3502796dca0d2c.tar.gz rails-f0fe5e30dab40c500186d5901f3502796dca0d2c.tar.bz2 rails-f0fe5e30dab40c500186d5901f3502796dca0d2c.zip |
WTF, tabs?
Diffstat (limited to 'lib/arel')
-rw-r--r-- | lib/arel/nodes/with.rb | 12 | ||||
-rw-r--r-- | lib/arel/select_manager.rb | 32 | ||||
-rw-r--r-- | lib/arel/visitors/to_sql.rb | 34 |
3 files changed, 39 insertions, 39 deletions
diff --git a/lib/arel/nodes/with.rb b/lib/arel/nodes/with.rb index 0745080cc3..7f08abe47d 100644 --- a/lib/arel/nodes/with.rb +++ b/lib/arel/nodes/with.rb @@ -1,10 +1,10 @@ module Arel - module Nodes - class With < Arel::Nodes::Unary - alias children expr - end + module Nodes + class With < Arel::Nodes::Unary + alias children expr + end - class WithRecursive < With; end - end + class WithRecursive < With; end + end end diff --git a/lib/arel/select_manager.rb b/lib/arel/select_manager.rb index 8f5995e32c..4e1382224d 100644 --- a/lib/arel/select_manager.rb +++ b/lib/arel/select_manager.rb @@ -31,7 +31,7 @@ module Arel def where_clauses if $VERBOSE - warn "(#{caller.first}) where_clauses is deprecated and will be removed in arel 3.0.0 with no replacement" + warn "(#{caller.first}) where_clauses is deprecated and will be removed in arel 3.0.0 with no replacement" end to_sql = Visitors::ToSql.new @engine @ctx.wheres.map { |c| to_sql.accept c } @@ -135,24 +135,24 @@ module Arel end def union operation, other = nil - if operation.is_a? Symbol - node_class = Nodes.const_get("Union#{operation.to_s.capitalize}") - else - other = operation - node_class = Nodes::Union - end + if operation.is_a? Symbol + node_class = Nodes.const_get("Union#{operation.to_s.capitalize}") + else + other = operation + node_class = Nodes::Union + end - node_class.new self.ast, other.ast - end + node_class.new self.ast, other.ast + end def with *subqueries - if subqueries.first.is_a? Symbol - node_class = Nodes.const_get("With#{subqueries.shift.to_s.capitalize}") - else - node_class = Nodes::With - end - @ast.with = node_class.new(subqueries.flatten) - end + if subqueries.first.is_a? Symbol + node_class = Nodes.const_get("With#{subqueries.shift.to_s.capitalize}") + else + node_class = Nodes::With + end + @ast.with = node_class.new(subqueries.flatten) + end def take limit @ast.limit = Nodes::Limit.new(limit) diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index e021b5a707..7cb4213fbb 100644 --- a/lib/arel/visitors/to_sql.rb +++ b/lib/arel/visitors/to_sql.rb @@ -48,7 +48,7 @@ module Arel (#{caller.first}) Using UpdateManager without setting UpdateManager#key is deprecated and support will be removed in ARel 3.0.0. Please set the primary key on UpdateManager using UpdateManager#key= -eowarn + eowarn key = o.relation.primary_key end @@ -75,8 +75,8 @@ eowarn "INSERT INTO #{visit o.relation}", ("(#{o.columns.map { |x| - quote_column_name x.name - }.join ', '})" unless o.columns.empty?), + quote_column_name x.name + }.join ', '})" unless o.columns.empty?), (visit o.values if o.values), ].compact.join ' ' @@ -129,7 +129,7 @@ eowarn def visit_Arel_Nodes_SelectStatement o [ - (visit(o.with) if o.with), + (visit(o.with) if o.with), o.cores.map { |x| visit_Arel_Nodes_SelectCore x }.join, ("ORDER BY #{o.orders.map { |x| visit x }.join(', ')}" unless o.orders.empty?), (visit(o.limit) if o.limit), @@ -151,20 +151,20 @@ eowarn end def visit_Arel_Nodes_With o - "WITH #{o.children.map { |x| visit x }.join(', ')}" - end + "WITH #{o.children.map { |x| visit x }.join(', ')}" + end - def visit_Arel_Nodes_WithRecursive o - "WITH RECURSIVE #{o.children.map { |x| visit x }.join(', ')}" - end + def visit_Arel_Nodes_WithRecursive o + "WITH RECURSIVE #{o.children.map { |x| visit x }.join(', ')}" + end - def visit_Arel_Nodes_Union o - "( #{visit o.left} UNION #{visit o.right} )" - end + def visit_Arel_Nodes_Union o + "( #{visit o.left} UNION #{visit o.right} )" + end - def visit_Arel_Nodes_UnionAll o - "( #{visit o.left} UNION ALL #{visit o.right} )" - end + def visit_Arel_Nodes_UnionAll o + "( #{visit o.left} UNION ALL #{visit o.right} )" + end def visit_Arel_Nodes_Having o "HAVING #{visit o.expr}" @@ -303,11 +303,11 @@ eowarn end def visit_Arel_Nodes_In o - "#{visit o.left} IN (#{visit o.right})" + "#{visit o.left} IN (#{visit o.right})" end def visit_Arel_Nodes_NotIn o - "#{visit o.left} NOT IN (#{visit o.right})" + "#{visit o.left} NOT IN (#{visit o.right})" end def visit_Arel_Nodes_And o |