Sha256: 4a5c631b1b7bdf126b36d14da1665281611f6511f7857a99e2ffb1e517596cb9

Contents?: true

Size: 1.43 KB

Versions: 16

Compression:

Stored size: 1.43 KB

Contents

require 'active_support/core_ext/module/delegation'
require 'active_support/core_ext/module/attribute_accessors'

module Itsf
  module Backend
    module Configuration
      def configure
        yield self
      end

      mattr_accessor(:backend_engines) { [] }
      mattr_accessor(:resource_base_controller) { '::ApplicationController' }
      mattr_accessor(:service_base_controller) { '::ApplicationController' }
      mattr_accessor(:dashboard_base_controller) { '::ApplicationController' }
      mattr_accessor(:home_base_controller) { '::ApplicationController' }
      mattr_accessor :engine_mount_point
      mattr_accessor :title_link
      mattr_accessor :resource_title_methods
      mattr_accessor(:enabled_features) { [] }
      mattr_accessor(:hidden_attributes_for) do
        { index: [], show: [], edit: [] }
      end
      mattr_accessor(:default_pagination_size) { 15 }
      mattr_accessor(:resource_links) { [] }
      mattr_accessor(:collection_links) { [] }
      mattr_accessor(:additional_resource_route_blocks) { [] }

      def registered_controllers
        backend_engines.call.collect do |engine|
          "#{engine.parent}::Configuration".constantize.registered_controllers.call
        end.flatten
      end

      def registered_resources
        registered_controllers.call.collect do |controller|
          controller.resource_class if controller.respond_to?(:resource_class)
        end.compact
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
itsf_backend-4.2.3 lib/itsf/backend/configuration.rb
itsf_backend-4.2.2 lib/itsf/backend/configuration.rb
itsf_backend-4.2.1 lib/itsf/backend/configuration.rb
itsf_backend-4.2.0 lib/itsf/backend/configuration.rb
itsf_backend-4.0.1 lib/itsf/backend/configuration.rb
itsf_backend-4.0.0 lib/itsf/backend/configuration.rb
itsf_backend-3.1.1 lib/itsf/backend/configuration.rb
itsf_backend-3.1.0 lib/itsf/backend/configuration.rb
itsf_backend-3.0.7 lib/itsf/backend/configuration.rb
itsf_backend-3.0.6 lib/itsf/backend/configuration.rb
itsf_backend-3.0.5 lib/itsf/backend/configuration.rb
itsf_backend-3.0.4 lib/itsf/backend/configuration.rb
itsf_backend-3.0.3 lib/itsf/backend/configuration.rb
itsf_backend-3.0.2 lib/itsf/backend/configuration.rb
itsf_backend-3.0.1 lib/itsf/backend/configuration.rb
itsf_backend-3.0.0 lib/itsf/backend/configuration.rb