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 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060705/6a2465e9/attachment.html
On Jul 5, 2006, at 4:21 PM, Dennis_Byrne@ak.blm.gov 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?> jeremyDennis Byrne -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060706/671c4a11/attachment.html
On Jul 5, 2006, at 5:17 PM, Dennis_Byrne@ak.blm.gov 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
Maybe Matching Threads
- Created_on and updated_on in a non-ActiveRecord model
- How to write manage created_on and created_by via mixin?
- created_on, created_at defaulting to 2000/01/01 00:00:00
- AR many-many join tables - can they have created_on, updated_on ?
- accessing created_on causes type error