V
V
Vasily Shakhunov2018-01-30 15:37:42
Ruby on Rails
Vasily Shakhunov, 2018-01-30 15:37:42

How to compare a table with its previous state?

There is an application for accounting for sports competitions. There is a matches model that stores data about teams and points earned.
After each match, a results table is formed. In which all points for matches are summed up, and you need to somehow track the movement of the team in the rating table. That is, team A received points and moved from 3rd to 2nd place in the overall standings. An upward arrow is drawn on this occasion. How to trace such movement?
How can this be implemented?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
blackst0ne, 2018-01-31
@inf

1. You can add a movement history table.
2. You can add a "previous value" field. And when displaying each command, check the current position with the value from the "previous value" field.
3. You can use rail "dirty methods" .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question