E
E
eliastro2014-09-04 09:50:28
Ruby on Rails
eliastro, 2014-09-04 09:50:28

How to organize a tracker for performing daily repetitive tasks (for example, running for 20 days, going to bed before midnight, etc.)?

I decided to write a goal tracker where you need to mark the daily completion of a task (completed / failed / skipped). For example, do not smoke for a certain period. And every day you mark whether you have done or not done. There can be several goals and each has its own period. How to properly organize the storage of data, models from the point of view of the rails way?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
vsuhachev, 2014-09-04
@vsuhachev

I don’t know where the rails are here, I would do this:
1) We have options for describing the frequency, for example:
- once every N hours, starting from such and such a time stamp
- manually specify the periods in the form of their list with start and end dates
- somehow
2 ) We have goals with reference to the types of periodicity from paragraph
1 3) We store marks of completion with reference to the goal.
4) For each type of periodicity from item 1, we have an algorithm that, knowing how the periodicity is set for this type and using the execution marks, can calculate which periods were skipped and which were not.

I
Ilya Lozer, 2014-09-11
@ammet

railscasts.com/episodes/164-cron-in-ruby

L
lightcaster, 2014-09-12
@lightcaster

Take a notebook, write a task and put a tick.
And don't come up with excuses like "now I'll write a program in Ruby and now I'll definitely run every day" :).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question