Closed lethunder closed 4 years ago
The new version of rails-settings-cached has been remove source
method.
Please checkout the README guides to get a right way to use it.
thanks for your quick answer. i red readme. But does it mean that is no more possible to use app.yml with the gem?
NO, it will not supports it.
The new version changed to use field
method to define setting keys in app/models/setting.rb
.
Here is an example:
https://github.com/ruby-china/homeland/blob/master/app/models/setting.rb
thanks
hello eveyone,
this line in setting model
source Rails.root.join("config/app.yml")
generates and error /home/lethunder/.rvm/gems/ruby-2.6.5/gems/activerecord-5.2.4.1/lib/active_record/dynamic_matchers.rb:22:in (NoMethodError)
method_missing': undefined method
source' for #model looks like this class Setting < RailsSettings::Base source Rails.root.join("config/app.yml")
cache_prefix { "v1" }
end
Any idea?
ruby 2.6.5p114 Rails 5.2.4.1