-1

In my rails project, I am going to update longitude and latitude field of location table, but I want to update 100 records each day until end of records. Who can give me a suggest?

Hung
  • 459
  • 5
  • 15
  • 1
    How about you update 100 records each day until end of records? That should achieve your goal. – jvillian Jul 27 '17 at 04:38
  • I want to run rake task to update all records but each day only update 100 records until the end. – Hung Jul 27 '17 at 04:42
  • 1
    Sounds great! God for it! – jvillian Jul 27 '17 at 04:46
  • can you please provide the code you wrote and explain the issue you have? It's difficult (as jvillain is trying to suggest you) to solve your problem if we don't know what you tried and why is not working. – coorasse Jul 27 '17 at 06:19
  • @coorasse Thank you for comment, now I can solve it with delayed_job: https://github.com/collectiveidea/delayed_job#rails-42 – Hung Jul 27 '17 at 06:26

1 Answers1

0

Simply make a rake task which will take 100 records (which are not updated yet) and update it.
Now you can schedule this task to run everyday.

For example if you are using Heroku you can use Heroku Scheduler to schedul you rake task. And its free

Abdullah
  • 2,015
  • 2
  • 20
  • 29