From 3a36df69b7b8913d333b508da0a6b6cdb68bc6f5 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 9 Sep 2010 09:27:29 -0700 Subject: Table#join will noop when nil is passed --- spec/arel/table_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spec/arel/table_spec.rb') diff --git a/spec/arel/table_spec.rb b/spec/arel/table_spec.rb index 46d9dbddf4..6512ab310b 100644 --- a/spec/arel/table_spec.rb +++ b/spec/arel/table_spec.rb @@ -23,6 +23,12 @@ module Arel end describe 'join' do + it 'noops on nil' do + mgr = @relation.join nil + + mgr.to_sql.should be_like %{ SELECT FROM "users" } + end + it 'takes a second argument for join type' do right = @relation.alias predicate = @relation[:id].eq(right[:id]) -- cgit v1.2.3