Hi I have the following question. Given there is a user that has_many Notes. And a Note belongs_to a user.
user = User.new(name:'John')
note = user.notes.new(title:'test')
user.delay.remind_me
I want that DJ also includes the notes and not only the user object. Is there a way to do this? I know it is better to only store a user_id into the DJ que but I don’t want store this data to the DB so am trying this.
Thanks
remind_memethod should take care of retrieving the notes from the user. Like this:But that said, I would suggest not storing the user object in the DelayedJob queue.
You can rather do something like this: