I am looking at using the gem google maps for rails but cant see how I can use delayed_job to get the cords after creating a new record.
Has anyone come across this gem before with using delayed_job
Hope someone can advise.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Alright, I’m not sure how much you know about Delayed Job, so I’ll start there.
Delayed job can utilize any class that responds to ‘#perform’, so the first thing you need is a class for getting the coordinates and storing them in your model.
Then you just need to enqueue that job in an after_create hook in the model
So that way, after each record is created, you will queue up the grabbing of the coordinates in the background while keeping your response time snappy.