diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-03-24 17:18:56 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-03-24 17:18:56 -0700 |
commit | 6d47c4cae51fe5fd04ef999de96f54138cae7f88 (patch) | |
tree | 5151989678dfe3d66c68f5f6a9fce02fea1f8e26 /lib/arel/nodes.rb | |
parent | d38352ef9e63ec6e1ffee3e4fe78101df36bd6d8 (diff) | |
download | rails-6d47c4cae51fe5fd04ef999de96f54138cae7f88.tar.gz rails-6d47c4cae51fe5fd04ef999de96f54138cae7f88.tar.bz2 rails-6d47c4cae51fe5fd04ef999de96f54138cae7f88.zip |
build quoted nodes in factory methods
Diffstat (limited to 'lib/arel/nodes.rb')
-rw-r--r-- | lib/arel/nodes.rb | 9 |
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 |