Ruby on Rails' ORM has a t.timestamps handler. It adds (and fills and updates) created_at/updated_at rows in your tables.
But I can think of some reasons when not to use timestamps:
Are there good rules of thumb on when to include updated_at and created_at columns and when to leave them out?
Are my reasons not to use them valid? Or can that be ignored and should I simply go with "just add them, regardless, you never know when you might need them"?
Answers. Yes, your accessement regarding timestamp is correct and you should have it in all tabels in SQL especially if you have Access front end. This will eliminate a possible problem with Access that another user has changed or modified a row since you have opened the record. >>
The proper way is to do a Time. now. getutc. to_i to get the proper timestamp amount as simply displaying the integer need not always be same as the utc timestamp due to time zone differences.
Youre absolutely right. If you dont need them, dont use them.
Well we use them in our scenario - several apps talk to each other using REST. It gives us possibility to compare two resources just by comparing the timestamps. We dont need to fetch whole resource and compare by attribute basic. This is my case when I need timestamps.
I keep them turned off when I dont need them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With