SamSaffron/MiniProfiler — pull request #58 by sriedel (2012-08-02 08:48:18+00:00)
Title: Be YAJL friendly

YAJL is used in many rails projects as an optimized JSON (de)serializer. The ruby implementation of YAJL doesn't like nil passed as a second parameter to JSON.generate and expects some kind of hash. If nil is passed, exceptions are thrown.

This patch will refrain from adding a second argument to the JSON.generate call if none was passed to the Rack::MiniProfiler::TimerStruct#to_json call.