1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

nooping on nil parameters

This commit is contained in:
Aaron Patterson 2010-09-07 15:27:08 -07:00
parent 5b480bc60b
commit d0e6b969d6
2 changed files with 7 additions and 0 deletions

View file

@ -19,6 +19,8 @@ module Arel
end
def join relation, klass = Nodes::InnerJoin
return self unless relation
case relation
when String, Nodes::SqlLiteral
raise if relation.blank?

View file

@ -86,6 +86,11 @@ module Arel
ON "users"."id" = "users_2"."id"
}
end
it 'noops on nil' do
manager = Arel::SelectManager.new Table.engine
check manager.join(nil).should == manager
end
end
describe 'joins' do