Fritz Anderson wrote:

> The application is not full Rails; it has no ActiveController instances.

That'll mean you'll miss out on Rails automatic connection verification.

>> You might like to call Message.verify_active_connections!
>> before your find.
> 
> An interesting proposition. verify_active_connections! has no rdoc 
> available, and in fact abstract/connection_specification.rb marks it 
> :nodoc:. Doesn't this suggest it isn't for typical use?

True. But your situation is not typical.

> I don't exactly see what the method does when a connection is lost. Its 
> last construct is a Hash#each_value, which doesn't suggest a useful 
> return value. Does it raise an exception? Which? And what am I to do 
> with it once I rescue it?

You just call it (ignoring any return value) before your find
to ensure the model's DB connection is established.

> Also, while I'm on Rails 1.2.6, I see that the method is deprecated for 
> 2.2.1 (and still undocumented as of 2.1).

On later versions of AR you can instead do Message.connection.verify!

-- 
Rails Wheels - Find Plugins, List & Sell Plugins - http://railswheels.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to