diff options
author | Sean Griffin <sean@thoughtbot.com> | 2015-01-27 09:52:54 -0700 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2015-01-27 09:52:54 -0700 |
commit | aac9da257f291ad8d2d4f914528881c240848bb2 (patch) | |
tree | 4ba06fbdc5f8f2d2a533abc7e7b3c0f14ad5d1aa /lib/arel/nodes | |
parent | d36a769234911c8374e09069eb054d4c60eb1b99 (diff) | |
download | rails-aac9da257f291ad8d2d4f914528881c240848bb2.tar.gz rails-aac9da257f291ad8d2d4f914528881c240848bb2.tar.bz2 rails-aac9da257f291ad8d2d4f914528881c240848bb2.zip |
Change the interface of `having` to match that of `where`
These two clauses have nearly identical semantics with regards to how
they would be constructed as an AST. It doesn't make sense for their
interfaces to be separate.
Diffstat (limited to 'lib/arel/nodes')
-rw-r--r-- | lib/arel/nodes/select_core.rb | 10 | ||||
-rw-r--r-- | lib/arel/nodes/unary.rb | 1 |
2 files changed, 5 insertions, 6 deletions
diff --git a/lib/arel/nodes/select_core.rb b/lib/arel/nodes/select_core.rb index 09ae420aa1..3696dd20af 100644 --- a/lib/arel/nodes/select_core.rb +++ b/lib/arel/nodes/select_core.rb @@ -2,7 +2,7 @@ module Arel module Nodes class SelectCore < Arel::Nodes::Node attr_accessor :top, :projections, :wheres, :groups, :windows - attr_accessor :having, :source, :set_quantifier + attr_accessor :havings, :source, :set_quantifier def initialize super() @@ -14,7 +14,7 @@ module Arel @projections = [] @wheres = [] @groups = [] - @having = nil + @havings = [] @windows = [] end @@ -35,14 +35,14 @@ module Arel @projections = @projections.clone @wheres = @wheres.clone @groups = @groups.clone - @having = @having.clone if @having + @havings = @havings.clone @windows = @windows.clone end def hash [ @source, @top, @set_quantifier, @projections, - @wheres, @groups, @having, @windows + @wheres, @groups, @havings, @windows ].hash end @@ -54,7 +54,7 @@ module Arel self.projections == other.projections && self.wheres == other.wheres && self.groups == other.groups && - self.having == other.having && + self.havings == other.havings && self.windows == other.windows end alias :== :eql? diff --git a/lib/arel/nodes/unary.rb b/lib/arel/nodes/unary.rb index 3d4a4b014a..a0062ff5be 100644 --- a/lib/arel/nodes/unary.rb +++ b/lib/arel/nodes/unary.rb @@ -23,7 +23,6 @@ module Arel %w{ Bin Group - Having Limit Not Offset |