diff options
author | Sebastian Martinez <sebastian@wyeworks.com> | 2011-04-22 12:59:05 -0300 |
---|---|---|
committer | Sebastian Martinez <sebastian@wyeworks.com> | 2011-04-22 12:59:05 -0300 |
commit | 02ee2003a8040e9e8de5f3258f88dfaaade06c27 (patch) | |
tree | e94b53c1a8a50543d71e3fc46f98b48e11c1c179 /activerecord/lib/active_record | |
parent | 0e2644cde043f1d7126fda0510d9961eb1692403 (diff) | |
download | rails-02ee2003a8040e9e8de5f3258f88dfaaade06c27.tar.gz rails-02ee2003a8040e9e8de5f3258f88dfaaade06c27.tar.bz2 rails-02ee2003a8040e9e8de5f3258f88dfaaade06c27.zip |
Added docs for #disconnect! on adapters
Diffstat (limited to 'activerecord/lib/active_record')
3 files changed, 6 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb index 3318075e9e..5f2e56c9c3 100644 --- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb @@ -310,6 +310,8 @@ module ActiveRecord connect end + # Disconnects from the database if already connected. Otherwise, this + # method does nothing. def disconnect! @connection.close rescue nil end diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index ba7852192e..53ea80cf15 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -276,7 +276,8 @@ module ActiveRecord super end - # Close the connection. + # Disconnects from the database if already connected. Otherwise, this + # method does nothing. def disconnect! clear_cache! @connection.close rescue nil diff --git a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb index 326f22ce82..2ceb62dfc2 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb @@ -90,6 +90,8 @@ module ActiveRecord sqlite_version >= '3.1.6' end + # Disconnects from the database if already connected. Otherwise, this + # method does nothing. def disconnect! super clear_cache! |