diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2005-11-28 21:00:03 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2005-11-28 21:00:03 +0000 |
commit | 75d0623b3d1a71be2c63099cdeca48df5e3d4331 (patch) | |
tree | c91d757b398035b185d7c7db844bb20981c6ba8b /activerecord/lib | |
parent | e47c8381e127fe36aa20f8343e46d065045a6445 (diff) | |
download | rails-75d0623b3d1a71be2c63099cdeca48df5e3d4331.tar.gz rails-75d0623b3d1a71be2c63099cdeca48df5e3d4331.tar.bz2 rails-75d0623b3d1a71be2c63099cdeca48df5e3d4331.zip |
MySQL: active? compatibility with the pure-Ruby driver. References #428.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3194 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-x | activerecord/lib/active_record/connection_adapters/mysql_adapter.rb | 6 |
1 files changed, 5 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 76ea6e6530..c43a84a386 100755 --- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb @@ -150,7 +150,11 @@ module ActiveRecord # CONNECTION MANAGEMENT ==================================== def active? - @connection.stat if @connection.respond_to?(:stat) + if @connection.respond_to?(:stat) + @connection.stat + else + @connection.query 'select 1' + end true rescue Mysql::Error false |