Sha256: 2e9b26b49439bc619fad28aa7891e84b557d0943aa95aba03897ff55581da2c1

Contents?: true

Size: 644 Bytes

Versions: 12

Compression:

Stored size: 644 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 controller_class
      configuration.controller_class.constantize
    end

    def title
      configuration.title
    end

    def layout
      configuration.layout
    end

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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
naf-2.1.6 lib/naf.rb
naf-2.1.5 lib/naf.rb
naf-2.1.4 lib/naf.rb
naf-2.1.3 lib/naf.rb
naf-2.1.2 lib/naf.rb
naf-2.1.1 lib/naf.rb
naf-2.1.0 lib/naf.rb
naf-2.0.4 lib/naf.rb
naf-2.0.3 lib/naf.rb
naf-2.0.2 lib/naf.rb
naf-2.0.1 lib/naf.rb
naf-2.0.0 lib/naf.rb