RoR problems with Created_At and PostgreSQL

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…

On Fri, 2006-03-17 at 01:43 +0100, Johannes H. 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

Craig W. wrote:

On Fri, 2006-03-17 at 01:43 +0100, Johannes H. 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.

Johannes H. wrote:

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