`if respond_to?(:request)` should be enough?