Module: ActiveRecord::Configuration::InstanceMethods
- Defined in:
- lib/active_record/configuration.rb
Instance Method Summary collapse
-
#reload(options = nil) ⇒ Object
Overrides this model’s #reload method by first resetting any requested changes to settings and then continuing to perform a standard #reload.
-
#save_settings ⇒ Boolean
Saves all settings with pending modificaitons.
-
#settings ⇒ Object
Returns an ActiveConfiguration::SettingManager that proxies all reads and writes of settings to ActiveConfiguration::SettingProxy objects for the specific setting requested.
-
#settings=(replacement_settings = {}) ⇒ Object
Writes over multiple settings at once.
-
#update_settings(replacement_settings = {}) ⇒ Boolean
Writes over multiple settings and saves all setting updates at once.
-
#validate_settings ⇒ Object
Runs validations against all settings with pending modificaitons.
Instance Method Details
#reload(options = nil) ⇒ Object
Overrides this model’s #reload method by first resetting any requested changes to settings and then continuing to perform a standard #reload.
Note: Can this be accomplished with a callback after #reload rather than overriding the #reload method?
original #reload method.
140 141 142 |
# File 'lib/active_record/configuration.rb', line 140 def reload( = nil) settings.reload && super() end |
#save_settings ⇒ Boolean
Saves all settings with pending modificaitons.
119 120 121 |
# File 'lib/active_record/configuration.rb', line 119 def save_settings settings.save end |
#settings ⇒ Object
Returns an ActiveConfiguration::SettingManager that proxies all reads and writes of settings to ActiveConfiguration::SettingProxy objects for the specific setting requested.
99 100 101 |
# File 'lib/active_record/configuration.rb', line 99 def settings @setting_manager ||= ActiveConfiguration::SettingManager.new(self) end |
#settings=(replacement_settings = {}) ⇒ Object
Writes over multiple settings at once.
106 107 108 |
# File 'lib/active_record/configuration.rb', line 106 def settings=(replacement_settings = {}) settings.write_settings(replacement_settings) end |
#update_settings(replacement_settings = {}) ⇒ Boolean
Writes over multiple settings and saves all setting updates at once.
128 129 130 |
# File 'lib/active_record/configuration.rb', line 128 def update_settings(replacement_settings = {}) settings.update_settings(replacement_settings) end |
#validate_settings ⇒ Object
Runs validations against all settings with pending modificaitons. Any errors are added to #errors.
112 113 114 |
# File 'lib/active_record/configuration.rb', line 112 def validate_settings settings.validate end |