module Rack
  class Tracker
    module Controller
      def tracker(&block)
        if block_given?
          yield(Rack::Tracker::HandlerDelegator.new(env))
        end
      end
    end
  end
end

module Rack
  class Tracker
    module Controller
      def tracker(&block)
        if block_given?
          yield(Rack::Tracker::HandlerDelegator.new(respond_to?(:request) ? request.env : env))
        end
      end
    end
  end
end

Add support for Rails 5.1
Add support for Rails 5.1

Rails controller `env` was deprecated and removed

but we love backwards compatibility and keep the old behaviour 





