mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
adding factory methods to node base class
This commit is contained in:
parent
fe35956bf7
commit
fef5e012c9
3 changed files with 6 additions and 1 deletions
|
@ -3,6 +3,7 @@ module Arel
|
|||
###
|
||||
# Abstract base class for all AST nodes
|
||||
class Node
|
||||
include Arel::FactoryMethods
|
||||
include Enumerable
|
||||
|
||||
###
|
||||
|
|
|
@ -6,7 +6,7 @@ module Arel
|
|||
alias :table_alias :name
|
||||
|
||||
def [] name
|
||||
Attribute.new self, name
|
||||
Attribute.new(self, name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,6 +2,10 @@ require 'helper'
|
|||
|
||||
module Arel
|
||||
class TestNode < MiniTest::Unit::TestCase
|
||||
def test_includes_factory_methods
|
||||
assert Node.new.respond_to?(:create_join)
|
||||
end
|
||||
|
||||
def test_all_nodes_are_nodes
|
||||
Nodes.constants.map { |k|
|
||||
Nodes.const_get(k)
|
||||
|
|
Loading…
Reference in a new issue