-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NoMethodError (undefined method `key?' for #<JSON::Ext::Generator::State:0x007........ #10
Comments
@twiduch This is a probably when using this with devise, because devise passes in the User or whichever model and not a user's attributes, don't know the fix yet |
+1 I'm getting the same error. This happened after upgrading from Rails 3.2 to 4.0. |
I pass to action mailer object id and there load object. It work!!! (not need to pass live object to mailer, only id) |
In order to use sidekiq_mailer you need to pass simple objects as parameters to actions. Instead of receiving complex Objects, such as User, you should pass user id, or any integer, string, boolean objects. |
In my case it was devise causing the problem, and a quick fix can be the following - you could also change devise as well Sidekiq::Mailer.excluded_environments = [:test, :cucumber]
# monkey patch so sidekiq mailer doesn't handle devises backgrounding
# which would try to serialize the user object
class Sidekiq::Mailer::Proxy
def deliver
return deliver! if Sidekiq::Mailer.excludes_current_environment? || @mailer_class.to_s == "Devise::Mailer"
Sidekiq::Mailer::Worker.client_push(to_sidekiq)
end
end |
I am getting that error when trying with sidekiq_mailer 0.0.6
The text was updated successfully, but these errors were encountered: