You need to create a Rack middleware that will add a timestamp for the request. For example (not tested, but this gives you an idea):
module Middleware
class Timestamp
def initialize(app)
@app = app
end
def call(env)
env[:timestamp] = Time.now
@app.call(env)
end
end
end
And add it to application.rb (config.middleware.use)
Roman source
share