diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2005-12-13 16:45:58 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2005-12-13 16:45:58 +0000 |
commit | 224d47e0a38167a92b37cc92a10ecaa97ede4a1d (patch) | |
tree | 1dfa5af1538ab0196818b632e74e5559999a594d | |
parent | 98068a71dfc8970d68ad8d31053faf387aa67c9d (diff) | |
download | rails-224d47e0a38167a92b37cc92a10ecaa97ede4a1d.tar.gz rails-224d47e0a38167a92b37cc92a10ecaa97ede4a1d.tar.bz2 rails-224d47e0a38167a92b37cc92a10ecaa97ede4a1d.zip |
MySQL: allow encoding option for mysql.rb driver.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3293 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | activerecord/CHANGELOG | 2 | ||||
-rwxr-xr-x | activerecord/lib/active_record/connection_adapters/mysql_adapter.rb | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index 1ffb8480cb..91f96b4c31 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* MySQL: allow encoding option for mysql.rb driver. [Jeremy Kemper] + * Added option inheritance for find calls on has_and_belongs_to_many and has_many assosociations [DHH]. Example: class Post diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb index 14991c2171..4cc08c01ae 100755 --- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb @@ -311,11 +311,7 @@ module ActiveRecord def connect encoding = @config[:encoding] if encoding - begin - @connection.options(Mysql::SET_CHARSET_NAME, encoding) - rescue - raise ActiveRecord::ConnectionFailed, 'The :encoding option is only available for MySQL 4.1 and later with the mysql-ruby driver. Again, this does not work with the ruby-mysql driver or MySQL < 4.1.' - end + @connection.options(Mysql::SET_CHARSET_NAME, encoding) rescue nil end @connection.real_connect(*@connection_options) execute("SET NAMES '#{encoding}'") if encoding |