diff options
author | Ryan Bigg <radarlistener@gmail.com> | 2008-09-17 23:02:21 +0930 |
---|---|---|
committer | Ryan Bigg <radarlistener@gmail.com> | 2008-09-17 23:02:21 +0930 |
commit | 0788cdff19f017460e7ff9b77610ae5400b97a4b (patch) | |
tree | 7f13b66eb988949831337fdb9632e7e7de2c34e0 /activerecord | |
parent | e025d4335aeb4f7e582519ce0529bee44052f1ef (diff) | |
parent | 161647ea8998ca78c39d8d78c196cef32ca7baa2 (diff) | |
download | rails-0788cdff19f017460e7ff9b77610ae5400b97a4b.tar.gz rails-0788cdff19f017460e7ff9b77610ae5400b97a4b.tar.bz2 rails-0788cdff19f017460e7ff9b77610ae5400b97a4b.zip |
Merge branch 'master' of git@github.com:lifo/docrails
Diffstat (limited to 'activerecord')
-rwxr-xr-x | activerecord/lib/active_record/connection_adapters/abstract_adapter.rb | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb index 7c37916367..6c96ed5b35 100755 --- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb @@ -91,17 +91,21 @@ module ActiveRecord # CONNECTION MANAGEMENT ==================================== - # Is this connection active and ready to perform queries? + # Checks whether the connection to the database is still active. This includes + # checking whether the database is actually capable of responding, i.e. whether + # the connection isn't stale. def active? @active != false end - # Close this connection and open a new one in its place. + # Disconnects from the database if already connected, and establishes a + # new connection with the database. def reconnect! @active = true end - # Close this connection + # Disconnects from the database if already connected. Otherwise, this + # method does nothing. def disconnect! @active = false end @@ -121,15 +125,19 @@ module ActiveRecord false end - # Verify this connection by calling <tt>active?</tt> and reconnecting if - # the connection is no longer active. + # Checks whether the connection to the database is still active (i.e. not stale). + # This is done under the hood by calling <tt>active?</tt>. If the connection + # is no longer active, then this method will reconnect to the database. def verify!(*ignored) reconnect! unless active? end - # Provides access to the underlying database connection. Useful for - # when you need to call a proprietary method such as postgresql's lo_* - # methods + # Provides access to the underlying database driver for this adapter. For + # example, this method returns a Mysql object in case of MysqlAdapter, + # and a PGconn object in case of PostgreSQLAdapter. + # + # This is useful for when you need to call a proprietary method such as + # PostgreSQL's lo_* methods. def raw_connection @connection end |