Skip to content

Commit a6f2ece

Browse files
committed
Fix for wrong raising exception
1 parent ed05c3c commit a6f2ece

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/gon.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,8 @@ def set_variable(name, value)
6666
if options.first.is_a? String
6767
warn "[DEPRECATION] view_path argument is now optional. If you need to specify it please use #{builder}(:template => 'path')"
6868
options = options.extract_options!.merge(:template => options[0])
69-
elsif options.first.is_a? Hash
70-
options = options ? options.first : { }
7169
else
72-
raise ArgumentError.new("You pass wrong argument type to template generator method: #{options.first.class.to_s}")
70+
options = (options && options.first.is_a?(Hash)) ? options.first : { }
7371
end
7472

7573
builder_module = get_builder(builder_name)

0 commit comments

Comments
 (0)