aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/select_manager.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-11-05 14:09:09 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-11-05 14:09:09 -0700
commita1a01e2bb301a7a4ae5c5cdcc27ece9f7edf6c66 (patch)
treeb0c8cc190b8421c4e9f615e131ee1cd089ac2fba /lib/arel/select_manager.rb
parent424e39d6883e5ab53a0f2c5d27508b36b1fb5879 (diff)
downloadrails-a1a01e2bb301a7a4ae5c5cdcc27ece9f7edf6c66.tar.gz
rails-a1a01e2bb301a7a4ae5c5cdcc27ece9f7edf6c66.tar.bz2
rails-a1a01e2bb301a7a4ae5c5cdcc27ece9f7edf6c66.zip
renaming @head to @ast
Diffstat (limited to 'lib/arel/select_manager.rb')
-rw-r--r--lib/arel/select_manager.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/arel/select_manager.rb b/lib/arel/select_manager.rb
index 7c3c67b477..f2520f38d7 100644
--- a/lib/arel/select_manager.rb
+++ b/lib/arel/select_manager.rb
@@ -4,13 +4,13 @@ module Arel
def initialize engine, table = nil
super(engine)
- @head = Nodes::SelectStatement.new
- @ctx = @head.cores.last
+ @ast = Nodes::SelectStatement.new
+ @ctx = @ast.cores.last
from table
end
def taken
- @head.limit
+ @ast.limit
end
def constraints
@@ -18,7 +18,7 @@ module Arel
end
def skip amount
- @head.offset = Nodes::Offset.new(amount)
+ @ast.offset = Nodes::Offset.new(amount)
self
end
@@ -31,12 +31,12 @@ module Arel
def lock locking = true
# FIXME: do we even need to store this? If locking is +false+ shouldn't
# we just remove the node from the AST?
- @head.lock = Nodes::Lock.new
+ @ast.lock = Nodes::Lock.new
self
end
def locked
- @head.lock
+ @ast.lock
end
def on *exprs
@@ -108,14 +108,14 @@ module Arel
def order *expr
# FIXME: We SHOULD NOT be converting these to SqlLiteral automatically
- @head.orders.concat expr.map { |x|
+ @ast.orders.concat expr.map { |x|
String === x || Symbol === x ? Nodes::SqlLiteral.new(x.to_s) : x
}
self
end
def orders
- @head.orders
+ @ast.orders
end
def wheres
@@ -130,7 +130,7 @@ module Arel
end
def take limit
- @head.limit = limit
+ @ast.limit = limit
self
end
@@ -142,7 +142,7 @@ module Arel
end
def order_clauses
- Visitors::OrderClauses.new(@engine).accept(@head).map { |x|
+ Visitors::OrderClauses.new(@engine).accept(@ast).map { |x|
Nodes::SqlLiteral.new x
}
end