huacnlee / rails-settings-cached

Global settings for your Rails application.
Other
1.06k stars 202 forks source link

Setting.<key> doesn't work on mailer [production] #136

Closed distroid closed 6 years ago

distroid commented 6 years ago

I have base class for mailer with default configs:

class CustomerMailer < ApplicationMailer
  default reply_to: Setting.email_reply_to
end

On development all works as expect, but on staging or production Setting.email_reply_to always return nil. But if i get this value from rails c all works, problem only on mailer.

For fix this problem i changed

Setting.email_reply_to

to

Setting.find_by(var: 'email_reply_to').value

Why this happend?

huacnlee commented 6 years ago

Check your caching