diff options
-rw-r--r-- | lib/arel/nodes.rb | 1 | ||||
-rw-r--r-- | lib/arel/nodes/grouping.rb | 7 | ||||
-rw-r--r-- | lib/arel/nodes/ordering.rb | 6 | ||||
-rw-r--r-- | lib/arel/nodes/unary.rb | 1 | ||||
-rw-r--r-- | test/nodes/test_grouping.rb | 13 |
5 files changed, 21 insertions, 7 deletions
diff --git a/lib/arel/nodes.rb b/lib/arel/nodes.rb index 0477591cae..54caea69a1 100644 --- a/lib/arel/nodes.rb +++ b/lib/arel/nodes.rb @@ -13,6 +13,7 @@ require 'arel/nodes/false' # unary require 'arel/nodes/unary' +require 'arel/nodes/grouping' require 'arel/nodes/ascending' require 'arel/nodes/descending' require 'arel/nodes/unqualified_column' diff --git a/lib/arel/nodes/grouping.rb b/lib/arel/nodes/grouping.rb new file mode 100644 index 0000000000..e7f4bd9cd5 --- /dev/null +++ b/lib/arel/nodes/grouping.rb @@ -0,0 +1,7 @@ +module Arel + module Nodes + class Grouping < Unary + include Arel::Predications + end + end +end diff --git a/lib/arel/nodes/ordering.rb b/lib/arel/nodes/ordering.rb deleted file mode 100644 index efb4d18ae4..0000000000 --- a/lib/arel/nodes/ordering.rb +++ /dev/null @@ -1,6 +0,0 @@ -module Arel - module Nodes - class Ordering < Unary - end - end -end diff --git a/lib/arel/nodes/unary.rb b/lib/arel/nodes/unary.rb index 4688fff623..7828cceae5 100644 --- a/lib/arel/nodes/unary.rb +++ b/lib/arel/nodes/unary.rb @@ -12,7 +12,6 @@ module Arel %w{ Bin Group - Grouping Having Limit Not diff --git a/test/nodes/test_grouping.rb b/test/nodes/test_grouping.rb new file mode 100644 index 0000000000..3f84ac301e --- /dev/null +++ b/test/nodes/test_grouping.rb @@ -0,0 +1,13 @@ +require 'helper' + +module Arel + module Nodes + describe 'Grouping' do + it 'should create Equality nodes' do + grouping = Grouping.new('foo') + grouping.eq('foo').to_sql.must_be_like %q{('foo') = 'foo'} + end + end + end +end + |