Sha256: aeb120da3c401fc0cd422cb593bed049066a7de6a0250c6818273d96b230a6b8

Contents?: true

Size: 870 Bytes

Versions: 1

Compression:

Stored size: 870 Bytes

Contents

# frozen_string_literal: true

module JSONAPI
  class ResourceControllerMetal < ActionController::Metal
    MODULES = [
      AbstractController::Rendering,
      ActionController::Rendering,
      ActionController::Renderers::All,
      ActionController::StrongParameters,
      Gem::Requirement.new('< 6.1').satisfied_by?(ActionPack.gem_version) ? ActionController::ForceSSL : nil,
      ActionController::Instrumentation,
      JSONAPI::ActsAsResourceController
    ].compact.freeze

    # Note, the url_helpers are not loaded. This will prevent links from being generated for resources, and warnings
    # will be emitted. Link support can be added by including `Rails.application.routes.url_helpers`, and links
    # can be disabled, and warning suppressed, for a resource with `exclude_links :default`
    MODULES.each do |mod|
      include mod
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jsonapi-resources-0.11.0.beta2 lib/jsonapi/resource_controller_metal.rb