weixin_39942474
weixin_39942474
2020-12-08 23:42

Bleach loaded before config

Rails 3.0.11 .. The railtie:


config.before_configuration do
      ActionMailer::Base.register_interceptor(SanitizeEmail::Bleach.new)
end

loads Bleach, which attempts to load the SanitizeEmail::Config information, before the initializer has run to set those values.

该提问来源于开源项目:pboling/sanitize_email

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

4条回答

  • weixin_39989159 weixin_39989159 5月前

    Rails 3.0 didn't support Engines (support added in 3.1), where I use the to_prepare instead of before_configuration. The railtie is only loaded for Rails 3.0. I am not sure what the correct solution would be for Rails 3.0.

    点赞 评论 复制链接分享
  • weixin_39942474 weixin_39942474 5月前

    As I showed in the pull request, after_initialize seems to work for me.

    点赞 评论 复制链接分享
  • weixin_39989159 weixin_39989159 5月前

    Excellent. Thanks!

    点赞 评论 复制链接分享
  • weixin_39989159 weixin_39989159 5月前

    Version 1.0.5 has been released with this fix, among others. See CHANGELOG

    点赞 评论 复制链接分享

相关推荐