diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-12-14 17:45:14 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-12-19 13:24:54 +0300 |
commit | 0ff27ce05960598e5a1c0a1115180db0feeb689a (patch) | |
tree | 2ae5e499696fee4f080ad62b7f50b302772dbfed /app/models | |
parent | cc5099c5ce79a7c062e2197b47f5f8a81bb48292 (diff) |
Method `create_from_defaults` will never give nil
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/application_setting.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb index 54139f61a16..86ffd198ab1 100644 --- a/app/models/application_setting.rb +++ b/app/models/application_setting.rb @@ -311,7 +311,7 @@ class ApplicationSetting < ActiveRecord::Base end def self.create_from_defaults - create(defaults) + build_from_defaults.tap(&:save) end def self.human_attribute_name(attr, _options = {}) |