Sha256: 18ded05cc12f38c1e8437f6e18a90f95097b8f73945d503427bb51d619c0e3ae

Contents?: true

Size: 965 Bytes

Versions: 5

Compression:

Stored size: 965 Bytes

Contents

require "naf/engine"
require 'naf/configuration'

module Naf
  class << self
    attr_writer :configuration

    def configure
      yield(configuration)
    end

    def configuration
      @configuration ||= Configuration.new
    end

    def schema_name
      configuration.schema_name
    end

    def model_class
      configuration.model_class.constantize
    end

    def title
      configuration.title
    end

    def layout
      configuration.layout
    end

    def ui_controller_class
      configuration.ui_controller_class.constantize
    end

    def api_controller_class
      configuration.api_controller_class.constantize
    end

    def api_domain_cookie_name
      configuration.api_domain_cookie_name
    end

    def simple_cluster_authenticator_cookie_expiration_time
      configuration.simple_cluster_authenticator_cookie_expiration_time
    end

    def using_another_database?
      model_class != ActiveRecord::Base
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
naf-2.1.12 lib/naf.rb
naf-2.1.11 lib/naf.rb
naf-2.1.10 lib/naf.rb
naf-2.1.9 lib/naf.rb
naf-2.1.8 lib/naf.rb