Closed artur-intech closed 5 years ago
Also, the following code leads to "deadlock; recursive locking" error:
class Setting < RailsSettings::CachedSettings
class << self
def respond_to_missing?(method, include_all = false)
get_all.include?(method.to_s) || super
end
end
end
https://gist.github.com/artur-beljajev/1947c0b35509b776f216a5dedff82f51
https://github.com/huacnlee/rails-settings-cached/blob/master/lib/rails-settings/settings.rb#L21
I wonder if this is expected behaviour, since it seems quite confusing to me. The downside of this is the inability to mock/stub the settings, which prevents tests from accessing the database.