Module: Faalis::Configuration

Included in:
Engine
Defined in:
lib/faalis/configuration.rb

Overview

This module contains all the configuration of ‘Faalis::Engine` which can be setup in `config/initializer/faalis.rb`

Constant Summary collapse

@@modules_to_load =
{}

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#site_titleObject

Site Title



42
43
44
# File 'lib/faalis/configuration.rb', line 42

def site_title
  @site_title
end

Instance Method Details

#collect_i18n_missing_keys=(value) ⇒ Object

We have to move this method somewhere else



31
32
33
34
35
# File 'lib/faalis/configuration.rb', line 31

def collect_i18n_missing_keys=(value)
  if value
    ::I18n.exception_handler = Faalis::I18n::MissingKeyHandler.new
  end
end

#enabled?(configuration) ⇒ Boolean

Returns:

  • (Boolean)


93
94
95
# File 'lib/faalis/configuration.rb', line 93

def enabled?(configuration)
  @@modules_to_load.include? configuration
end

#load_dependencies_based_on_configurationObject

Load all the features dependencies based on their configuration value. For example if ‘amd` class method returns true all of its dependencies will be loaded.



87
88
89
90
91
# File 'lib/faalis/configuration.rb', line 87

def load_dependencies_based_on_configuration
  @@modules_to_load.each do |k, v|
    v.map { |mod| require mod } if send(k)
  end
end

#orm=(orm_name) ⇒ Object



25
26
27
28
# File 'lib/faalis/configuration.rb', line 25

def orm=(orm_name)
  @@orm = orm_name
  require "devise/orm/#{orm_name}"
end