Ruby on Rails latest stable (v5.2.3) - 1 note - Class: ActiveRecord::Base

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v3.2.13) is shown here.

These similar methods exist in v5.2.3:

connection() public

Returns the connection currently associated with the class. This can also be used to “borrow” the connection to do database work unrelated to any of the specific Active Records.

Show source
Register or log in to add new notes.
August 20, 2008
3 thanks

Current Database Name

The MySQL database adapter extends this and allows you to call


to get the current databases name. Useful when you are actively changing the database you are connected to and sometimes need to check the current one.