开发者

Rails 2.3.X weird problem with Created On

Hey everyone... I've been out of the game for awhile so you're going to have to excuse the fact that it's Rails2.3

Currently the app is running 2.3.3, I just updated it to 2.3.11

An object is edited, and saved using the .save command and the SQL generated in the logs is as follows:开发者_开发知识库

UPDATE `calc_sheets` SET `is_us_connection` = 0, `holding_date_end` = '0001-02-11', `updated_on` = '2011-03-16 13:14:00', `extra_chars` = '' WHERE `id` = 657

however for some reason the created_on field is getting updated, and obviously shouldn't be. Is there some bug that I'm not aware of. I did some searching, looking and reading and nothing jumped out at me.

This is the only SQL call made during the action, so it's not as if something else is being updated or saved.

Any advice?

I realize this is out dated code, the app is fairly old, and the clients aren't ready to updated it... this "bug" however is causing all kinds of havoc.

Thanks in advance for any advice.


My guess is that the created_on table column is set to on "on update CURRENT_TIMESTAMP" (assuming mySQL) or something equivalent.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜