Sha256: 8954265cb70290313a2e03aeddd275619ddeb53a3b8a79791fff01cb9e9ff504

Contents?: true

Size: 516 Bytes

Versions: 4

Compression:

Stored size: 516 Bytes

Contents

module Apress
  module Api
    module ApiController
      module Responds
        extend ActiveSupport::Concern

        included do
          if (Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR == 2) || Rails::VERSION::MAJOR > 4
            before_action :set_json_format
          else
            before_filter :set_json_format
          end
        end

        private

        # :nocov:
        def set_json_format
          request.format = :json
        end
        # :nocov:
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
apress-api-1.24.0 lib/apress/api/api_controller/responds.rb
apress-api-1.23.0 lib/apress/api/api_controller/responds.rb
apress-api-1.22.1 lib/apress/api/api_controller/responds.rb
apress-api-1.22.0 lib/apress/api/api_controller/responds.rb