aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/nodes.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/arel/nodes.rb')
-rw-r--r--lib/arel/nodes.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/arel/nodes.rb b/lib/arel/nodes.rb
index 3642958cf8..6ce1ed7dba 100644
--- a/lib/arel/nodes.rb
+++ b/lib/arel/nodes.rb
@@ -62,6 +62,13 @@ module Arel
end
def nil?; @val.nil?; end
+
+ def eql? other
+ self.class == other.class &&
+ self.val == other.val &&
+ self.attribute == other.attribute
+ end
+ alias :== :eql?
end
class Quoted < Arel::Nodes::Unary # :nodoc:
@@ -69,7 +76,7 @@ module Arel
def self.build_quoted other, attribute = nil
case other
- when Arel::Nodes::Node, Arel::Attributes::Attribute
+ when Arel::Nodes::Node, Arel::Attributes::Attribute, Arel::Nodes::SelectStatement, Arel::Table, Arel::Nodes::BindParam
other
else
case attribute