mhfs/devise-async

NoMethodError: protected method devise_mailer called for <User:0x1b8a096f>

Closed this issue · 4 comments

I just received this error after doing some bundle updates

NoMethodError: protected method 'devise_mailer' called for #<User:0x1b8a096f>

Here is the relevant backtrace:

org/jruby/RubyKernel.java:1955 in "public_send"
/gems/activesupport-4.1.8/lib/active_support/core_ext/object/try.rb:45 in "try"
/gems/devise-async-0.9.0/lib/devise/async/backend/base.rb:22 in "mailer_class"
/gems/devise-async-0.9.0/lib/devise/async/backend/base.rb:16 in "perform"
/gems/sidekiq-3.3.0/lib/sidekiq/processor.rb:75 in "execute_job"
/gems/sidekiq-3.3.0/lib/sidekiq/processor.rb:52 in "process"
org/jruby/RubyProc.java:271 in "call"
/gems/sidekiq-3.3.0/lib/sidekiq/middleware/chain.rb:127 in "invoke"

As a temporary fix, we have removed the resource.try(:devise_mailer) for now.

We are using Devise 3.4.1 with sidekiq.

Hmm, the behavior of try changed in Rails 4.x. Did you move from Rails 3.x to 4.x with this bundle update?

Yes. Exactly. My bad, I forgot to mention the rails version change.

I don't see another solution to this problem besides using send in this case as devise_mailer is protected. Do you see a better solution? Otherwise, the “Multiple-Mailers-Per-Model” feature does not work anymore.

@baschtl - yeah, I can't think of a better way at the moment.