lib/mini_profiler/timer_struct.rb in rack-mini-profiler-0.1.9 vs lib/mini_profiler/timer_struct.rb in rack-mini-profiler-0.1.10
- old
+ new
@@ -20,10 +20,15 @@
attributes[name] = val
self
end
def to_json(*a)
- ::JSON.generate(@attributes, a[0])
+ if a[0] == nil
+ # YAJL doesnt like nil as options
+ ::JSON.generate( @attributes )
+ else
+ ::JSON.generate(@attributes, a[0])
+ end
end
end
end