Sha256: 38c6bd5775897bbf6ccedccd0e625aa15110e15a0e16445e4da43b9e05d692b8
Contents?: true
Size: 849 Bytes
Versions: 15
Compression:
Stored size: 849 Bytes
Contents
# frozen_string_literal: true # Rails 5 deprecates calling HTTP action methods with positional arguments # in favor of keyword arguments. However, the keyword argument form is only # supported in Rails 5+. Since we support back to 4, we need some sort of shim # to avoid super noisy deprecations when running tests. module RoutingHTTPMethodShim def get(path, **args) super(path, args[:params], args[:headers]) end def post(path, **args) super(path, args[:params], args[:headers]) end def put(path, **args) super(path, args[:params], args[:headers]) end end module ControllerHTTPMethodShim def process(action, http_method = "GET", **args) if (as = args.delete(:as)) @request.headers["Content-Type"] = Mime[as].to_s end super(action, http_method, args[:params], args[:session], args[:flash]) end end
Version data entries
15 entries across 15 versions & 2 rubygems