I’m not sure how to do this in rails (maybe its a common topic but I’m not even sure if the title is correct)
I have a product table with this fields
- Name
- Quantity
- Price
- Size
and the columns that rails provide (id, created_at, updated_at)
This table is going to be updated periodically (lets say each day or so) but I want to save the QUANTITY that is being ADDED, and the date/time of the actualization (UPDATE).
I’m not sure if it’s a design problem or something else.
Is there a way rails can handle this?
Thanks in advance
Javier QQ.
I’m not sure if this is exactly what you’re looking for… but you can try the papertrail Gem. It stores each update of your model and you can easily step backwards or forwards in time through them to inspect your model and what fields changed, so it sounds like it’d be pretty ideal for what you have in mind.