Module: Aker::Rails::ConfigurationExt
- Defined in:
- lib/aker/rails/configuration_ext.rb
Overview
Provides sugar for configuring Aker via a Rails application’s configuration.
The methods in this module operate on Aker’s global configuration, so changes made here will be visible on ‘Aker.configuration` and vice versa.
While everything here could be done with direct calls to methods on ‘Aker`, this integration emphasizes that Aker configuration **must be done during the configuration phase** of Rails boot (i.e., in `config/application.rb` and `config/environments/env.rb`). If Aker configuration is done in the initialization phase or later, some features will not work correctly.
Instance Method Summary collapse
-
#aker(&block) ⇒ Aker::Configuration
Access or update the Aker configuration in the context of this Rails application.
-
#aker=(aker_configuration) ⇒ void
Completely replace the Aker configuration.
Instance Method Details
#aker(&block) ⇒ Aker::Configuration
Access or update the Aker configuration in the context of this Rails application.
N.b.: While this method allows you to update the configuration at any time, some configuration options will only take full effect if they are set during the application’s initial boot.
48 49 50 51 52 53 |
# File 'lib/aker/rails/configuration_ext.rb', line 48 def aker(&block) if block Aker.configure(&block) end Aker.configuration end |
#aker=(aker_configuration) ⇒ void
This method returns an undefined value.
Completely replace the Aker configuration. This should only rarely (if ever) be necessary.
61 62 63 |
# File 'lib/aker/rails/configuration_ext.rb', line 61 def aker=(aker_configuration) Aker.configuration = aker_configuration end |