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:
parent
5b480bc60b
commit
d0e6b969d6
2 changed files with 7 additions and 0 deletions
|
@ -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?
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue