From b93a23827a2244ec730be1b46ec44fb368d00396 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 14 Sep 2010 13:39:33 -0700 Subject: adding an EXISTS node, update method will generate an IN clause --- lib/arel/nodes/exists.rb | 11 +++++++++++ lib/arel/nodes/select_statement.rb | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 lib/arel/nodes/exists.rb (limited to 'lib/arel/nodes') diff --git a/lib/arel/nodes/exists.rb b/lib/arel/nodes/exists.rb new file mode 100644 index 0000000000..167a345006 --- /dev/null +++ b/lib/arel/nodes/exists.rb @@ -0,0 +1,11 @@ +module Arel + module Nodes + class Exists + attr_reader :select_stmt + + def initialize select_stmt + @select_stmt = select_stmt + end + end + end +end diff --git a/lib/arel/nodes/select_statement.rb b/lib/arel/nodes/select_statement.rb index 6272fd126d..637ba5d1d0 100644 --- a/lib/arel/nodes/select_statement.rb +++ b/lib/arel/nodes/select_statement.rb @@ -14,7 +14,7 @@ module Arel def initialize_copy other super - @cores = @cores.clone + @cores = @cores.map { |x| x.clone } end end end -- cgit v1.2.3