Override created_on column name

We are using Rails for a project that must integrate with a legacy
database. Is there a way to get Rails to automatically set the
timestamp
for a column named something other created_on or updated_on ?

Also, how does one manipulate the size of the database connection pool?

Dennis Byrne

On Jul 5, 2006, at 4:21 PM, [email protected] wrote:

We are using Rails for a project that must integrate with a legacy
database. Is there a way to get Rails to automatically set the
timestamp for a column named something other created_on or updated_on?

Use Active Record callbacks to set their values to Time.now in
before_create/save.

Also, how does one manipulate the size of the database connection
pool?

Database connections are opened one per Rails instance (whether
FastCGI, Mongrel, or otherwise.)

jeremy

Hello Jeremy,

Use Active Record callbacks to set their values to Time.now in
before_create/save.

Thanks. I just read upon this in “Agile Web Dev. w/ Rails”.

Database connections are opened one per Rails instance (whether
FastCGI, Mongrel, or otherwise.)

By “Rails Instance”, you mean all requests must share the same
connection,
or each request gets it’s own connection?

jeremy

Dennis Byrne

On Jul 5, 2006, at 5:17 PM, [email protected] wrote:

Use Active Record callbacks to set their values to Time.now in
before_create/save.

Thanks. I just read upon this in “Agile Web Dev. w/ Rails”.

Database connections are opened one per Rails instance (whether
FastCGI, Mongrel, or otherwise.)

By “Rails Instance”, you mean all requests must share the same
connection, or each request gets it’s own connection?

Rails requests are processed serially (one request at a time, single
file) so only one connection is required. By ‘Rails instance’ I mean
a dispatch.fcgi/Mongrel/webrick/etc process. Rails ‘scales’ by
adding more processes, so if you’ve set up lighttpd with 4 fastcgi,
you’ll have 4 database connections.

jeremy