Sha256: d8eee0770608cb05d3287e1636afb3599c9f5c9d299591ff916f297cccaa302e

Contents?: true

Size: 1.28 KB

Versions: 17

Compression:

Stored size: 1.28 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(:disabled_features) { [] }
      mattr_accessor(:hidden_attributes_for) do
        { index: [], show: [], edit: [] }
      end
      mattr_accessor(:default_pagination_size) { 15 }

      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

17 entries across 17 versions & 1 rubygems

Version Path
itsf_backend-1.1.15 lib/itsf/backend/configuration.rb
itsf_backend-1.1.14 lib/itsf/backend/configuration.rb
itsf_backend-1.1.13 lib/itsf/backend/configuration.rb
itsf_backend-1.1.12 lib/itsf/backend/configuration.rb
itsf_backend-1.1.11 lib/itsf/backend/configuration.rb
itsf_backend-1.1.10 lib/itsf/backend/configuration.rb
itsf_backend-1.1.9 lib/itsf/backend/configuration.rb
itsf_backend-1.1.8 lib/itsf/backend/configuration.rb
itsf_backend-1.1.7 lib/itsf/backend/configuration.rb
itsf_backend-1.1.6 lib/itsf/backend/configuration.rb
itsf_backend-1.1.5 lib/itsf/backend/configuration.rb
itsf_backend-1.1.4 lib/itsf/backend/configuration.rb
itsf_backend-1.1.3 lib/itsf/backend/configuration.rb
itsf_backend-1.1.2 lib/itsf/backend/configuration.rb
itsf_backend-1.1.1 lib/itsf/backend/configuration.rb
itsf_backend-1.1.0 lib/itsf/backend/configuration.rb
itsf_backend-1.0.1 lib/itsf/backend/configuration.rb