aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/arel/select_manager.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/arel/select_manager.rb b/lib/arel/select_manager.rb
index c62101077a..0f70a461a3 100644
--- a/lib/arel/select_manager.rb
+++ b/lib/arel/select_manager.rb
@@ -50,6 +50,10 @@ module Arel
end
def from table
+ if String === table
+ return self if @ctx.froms.any? { |x| x.name.to_s == table }
+ end
+
@ctx.froms << table
self
end