ruby on rails - DJ doesn't deserialize an unsaved ActiveRecord model workaround -


The main problem is that my email does not send

with 'Railway 3.2.19' "Delayed_job_mongoid"

To send me an email

  UserMailer.delay.question (@question)  

is registered in my database Delay work but with error Error: Error: :: DocumentNotFound, Category: ContactForm, Primary Key: 54418fe3c4bff8bb17000008 (Problem: Document ID) 54418fe3c4bff8bb17000008 With Category For ContactForm Not found. Summary: When an ID or ID Calling ContactForm.find with the array, each parameter must match a document in the database or this error was raised for search ID (s): 54418fe3c4bff8bb17000008 ... (1 total) and the following IDs were not found : 54418fe3c4bff8bb17000008 Solution: An ID is in the database or the wrong Mongoid.raise_not_found_error configuration option is set, that would be the reason for not having a search for a single ID instead of raising this instead of raising it Moody errors, or only matched documents while searching for multiples.)

So access to my late job is not Co-ContactForm.class, or the file should be rendered

Do I need something in my early / late_jbb.bb? How can I get this? ContactForm.class is in the model

OK, so this is my fault

DJ does not deserialize an unsaved ActiveRecord model

this is the solution for

I

the controller

  ends with "PassingData" class e-mail controller & lt; ApplicationController def ask_question @questions = ContactForm.new (params) if @price. Legitimate? Contact_data = PassingData.serialize (@question) UserMailer.delay.question (contact_data) render stuff end-end  

mailer

  class UserMailer & LT; "Email@email.com" def (record) @record = PassingData.deserialize (record) mail (to: @ record.email, to: "email@email.com", subject to: ActionMailer :: Base default 'Some') End end  

Then in my config / initializers / delayed_job.rb I need

  Requires' CONTACT_FORM PassingData '' Is'  

Comments

Popular posts from this blog

c# - WPF Expander overlay used in ItemsControl -

c# - SignalR: "Protocol error: Unknown transport." when navigating to hub -

Android studio res/xml directory not found -