So, I wrote some pages which essentially created some articles which are saved to a database, which also include both the "magic" rows ''created_at'' and ''updated_at''. Now, on my development machine I''m running the MySQL-database and everything worked as I wanted it to. On the live server I''ve had to switch to PostgreSQL 8.1 due to some horrendous dependencies. Now, the weird thing is that everything works fine - save for the ''created_at''-timestamp. The ''updated_at''-timestamp is indeed updated as it should. Both are created by the exact same SQL statement and differ only by name. Ruby is Version 1.8.4, Rails is at 1.0.0 Any pointers as to what I might be doing wrong? I could of course set the timestamp myself... -- Posted via http://www.ruby-forum.com/.
On Fri, 2006-03-17 at 01:43 +0100, Johannes Hass wrote:> So, I wrote some pages which essentially created some articles which are > saved to a database, which also include both the "magic" rows > ''created_at'' and ''updated_at''. > > Now, on my development machine I''m running the MySQL-database and > everything worked as I wanted it to. On the live server I''ve had to > switch to PostgreSQL 8.1 due to some horrendous dependencies. > > Now, the weird thing is that everything works fine - save for the > ''created_at''-timestamp. The ''updated_at''-timestamp is indeed updated as > it should. Both are created by the exact same SQL statement and differ > only by name. > > Ruby is Version 1.8.4, Rails is at 1.0.0 > > Any pointers as to what I might be doing wrong? I could of course set > the timestamp myself...---- see if created_on works for you. Craig
Johannes Hass
2006-Mar-17 11:08 UTC
[Rails] Re: RoR problems with Created_At and PostgreSQL
Craig White wrote:> On Fri, 2006-03-17 at 01:43 +0100, Johannes Hass wrote: >> it should. Both are created by the exact same SQL statement and differ >> only by name. >> >> Ruby is Version 1.8.4, Rails is at 1.0.0 >> >> Any pointers as to what I might be doing wrong? I could of course set >> the timestamp myself... > ---- > see if created_on works for you. > > CraigI just found the error myself. You may not set a default value for the timestamp column ''created_at'' - if there''s a default value it will _always_ be used. -- Posted via http://www.ruby-forum.com/.
Jeroen Houben
2006-Mar-17 11:16 UTC
[Rails] Re: RoR problems with Created_At and PostgreSQL
Johannes Hass wrote:> Craig White wrote: >> On Fri, 2006-03-17 at 01:43 +0100, Johannes Hass wrote: >>> it should. Both are created by the exact same SQL statement and differ >>> only by name. >>> >>> Ruby is Version 1.8.4, Rails is at 1.0.0 >>> >>> Any pointers as to what I might be doing wrong? I could of course set >>> the timestamp myself... >> ---- >> see if created_on works for you. >> >> Craig > > I just found the error myself. You may not set a default value for the > timestamp column ''created_at'' - if there''s a default value it will > _always_ be used. >I had this problem too. http://dev.rubyonrails.org/ticket/2257 Jeroen