Permalink
Browse files

fixing the leg order of TableAlias nodes

  • Loading branch information...
1 parent f771b71 commit ff1718142c29d6373d07c108a9ea85a96d4ec62f @tenderlove tenderlove committed Mar 30, 2011
Showing with 4 additions and 3 deletions.
  1. +1 −0 History.txt
  2. +2 −2 lib/arel/nodes/table_alias.rb
  3. +1 −1 lib/arel/table.rb
View
@@ -19,6 +19,7 @@
* MSSQL adds TOP to sub selects
* Assigning nil to take() removes LIMIT from statement.
* Assigning nil to offset() removes OFFSET from statement.
+ * TableAlias leg ordering fixed
* Deprecations
@@ -1,8 +1,8 @@
module Arel
module Nodes
class TableAlias < Arel::Nodes::Binary
- alias :name :left
- alias :relation :right
+ alias :name :right
+ alias :relation :left
alias :table_alias :name
def [] name
View
@@ -43,7 +43,7 @@ def primary_key
end
def alias name = "#{self.name}_2"
- Nodes::TableAlias.new(name, self).tap do |node|
+ Nodes::TableAlias.new(self, name).tap do |node|
@aliases << node
end
end

0 comments on commit ff17181

Please sign in to comment.