LoginSignup
1
1

More than 5 years have passed since last update.

rails_configで値をブランクで上書きしたい

Posted at

問題

settings.yml
key: 適当な文字列
settings.local.yml
key: ''

と書いてやると

Settings[:key]

はブランクであって欲しい。

でも、実際には

適当な文字列

が出てしまった。

解決策

に書いてあった。

deep_merge を入れれば良いらしいので

gem 'deep_merge'
gem 'rails_config'

としておく。

rails_configの前にdeep_mergeをいれなito

warning: already initialized constant DeepMerge::DEFAULT_FIELD_KNOCKOUT_PREFIX

と出たので注意。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1