Sha256: 98fb854908dac189e9fa639f84e82f09a6242621df85b49aecbd04c20a6316d7

Contents?: true

Size: 632 Bytes

Versions: 17

Compression:

Stored size: 632 Bytes

Contents

module Workarea
  module Configuration
    class AdministrableOptions < ActiveSupport::InheritableOptions
      def method_missing(name, *args)
        static_config = super
        return static_config if static_config.present? || static_config.to_s == 'false'
        return static_config unless check_fieldsets?(name)

        Configuration::Admin.instance.send(name)
      end

      def respond_to_missing?(name, include_private)
        true
      end

      private

      def check_fieldsets?(name)
        ::Mongoid.clients.any? &&
          Configuration::Admin.fields.keys.include?(name.to_s)
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
workarea-core-3.5.15 lib/workarea/configuration/administrable_options.rb
workarea-core-3.5.14 lib/workarea/configuration/administrable_options.rb
workarea-core-3.5.13 lib/workarea/configuration/administrable_options.rb
workarea-core-3.5.12 lib/workarea/configuration/administrable_options.rb
workarea-core-3.5.11 lib/workarea/configuration/administrable_options.rb
workarea-core-3.5.10 lib/workarea/configuration/administrable_options.rb
workarea-core-3.5.9 lib/workarea/configuration/administrable_options.rb
workarea-core-3.5.8 lib/workarea/configuration/administrable_options.rb
workarea-core-3.5.7 lib/workarea/configuration/administrable_options.rb
workarea-core-3.5.6 lib/workarea/configuration/administrable_options.rb
workarea-core-3.5.5 lib/workarea/configuration/administrable_options.rb
workarea-core-3.5.4 lib/workarea/configuration/administrable_options.rb
workarea-core-3.5.3 lib/workarea/configuration/administrable_options.rb
workarea-core-3.5.2 lib/workarea/configuration/administrable_options.rb
workarea-core-3.5.1 lib/workarea/configuration/administrable_options.rb
workarea-core-3.5.0 lib/workarea/configuration/administrable_options.rb
workarea-core-3.5.0.beta.1 lib/workarea/configuration/administrable_options.rb