mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[core] making collection.new error more idiomatic
This commit is contained in:
parent
5cf271ff6c
commit
96a5c2f46a
1 changed files with 3 additions and 1 deletions
|
@ -94,7 +94,9 @@ module Fog
|
|||
end
|
||||
|
||||
def new(attributes = {})
|
||||
raise ArgumentError, "Initialization parameters must be an attributes hash, got #{attributes.inspect}" unless attributes.respond_to? :merge
|
||||
unless attributes.is_a?(Hash)
|
||||
raise(ArgumentError.new("Initialization parameters must be an attributes hash, got #{attributes.inspect}"))
|
||||
end
|
||||
model.new(
|
||||
attributes.merge(
|
||||
:collection => self,
|
||||
|
|
Loading…
Reference in a new issue