aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/arel/nodes
diff options
context:
space:
mode:
authorKevin Deisz <kevin.deisz@gmail.com>2019-01-24 14:35:52 -0500
committerKevin Deisz <kevin.deisz@gmail.com>2019-01-24 14:35:52 -0500
commit5cf36e2ea2242ea6ea0cf879adf9febd86fd3aa2 (patch)
tree8174d3d9c7b24a38a4410a380a89ac62c7a28351 /activerecord/lib/arel/nodes
parent1e25dfde032172bab2b126e60fac0302025defcc (diff)
downloadrails-5cf36e2ea2242ea6ea0cf879adf9febd86fd3aa2.tar.gz
rails-5cf36e2ea2242ea6ea0cf879adf9febd86fd3aa2.tar.bz2
rails-5cf36e2ea2242ea6ea0cf879adf9febd86fd3aa2.zip
Make `And` and `Case` into expression nodes
Allows aliasing, predications, ordering, and various other functions on `And` and `Case` nodes. This brings them in line with other nodes like `Binary` and `Unary`.
Diffstat (limited to 'activerecord/lib/arel/nodes')
-rw-r--r--activerecord/lib/arel/nodes/and.rb2
-rw-r--r--activerecord/lib/arel/nodes/case.rb4
2 files changed, 2 insertions, 4 deletions
diff --git a/activerecord/lib/arel/nodes/and.rb b/activerecord/lib/arel/nodes/and.rb
index c530a77bfb..bf516db35f 100644
--- a/activerecord/lib/arel/nodes/and.rb
+++ b/activerecord/lib/arel/nodes/and.rb
@@ -2,7 +2,7 @@
module Arel # :nodoc: all
module Nodes
- class And < Arel::Nodes::Node
+ class And < Arel::Nodes::NodeExpression
attr_reader :children
def initialize(children)
diff --git a/activerecord/lib/arel/nodes/case.rb b/activerecord/lib/arel/nodes/case.rb
index b8f83128c8..1c4b727bf6 100644
--- a/activerecord/lib/arel/nodes/case.rb
+++ b/activerecord/lib/arel/nodes/case.rb
@@ -2,9 +2,7 @@
module Arel # :nodoc: all
module Nodes
- class Case < Arel::Nodes::Node
- include Arel::AliasPredication
-
+ class Case < Arel::Nodes::NodeExpression
attr_accessor :case, :conditions, :default
def initialize(expression = nil, default = nil)