diff options
author | Stephen Blackstone <sblackstone@gmail.com> | 2015-12-11 18:19:26 -0500 |
---|---|---|
committer | Stephen Blackstone <sblackstone@gmail.com> | 2015-12-15 06:59:28 -0500 |
commit | 46fe546c5f8bf505eb2503e0a784991c69a1d223 (patch) | |
tree | f8c54ab894db1fabd7ac9807b56d13e2c1aff032 /activerecord/test/cases/adapters | |
parent | eb0e8e216fcf535a1e6b82720dfb7639fcc20ff2 (diff) | |
download | rails-46fe546c5f8bf505eb2503e0a784991c69a1d223.tar.gz rails-46fe546c5f8bf505eb2503e0a784991c69a1d223.tar.bz2 rails-46fe546c5f8bf505eb2503e0a784991c69a1d223.zip |
Allow users to pass flags from database.yml
Fix white-space
Add test case demonstrating flags are received by the adapter
Diffstat (limited to 'activerecord/test/cases/adapters')
-rw-r--r-- | activerecord/test/cases/adapters/mysql2/connection_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/mysql2/connection_test.rb b/activerecord/test/cases/adapters/mysql2/connection_test.rb index 507d024bb6..8fabcfb5c0 100644 --- a/activerecord/test/cases/adapters/mysql2/connection_test.rb +++ b/activerecord/test/cases/adapters/mysql2/connection_test.rb @@ -83,6 +83,13 @@ class Mysql2ConnectionTest < ActiveRecord::Mysql2TestCase assert_equal [['']], result.rows end end + + def test_passing_arbitary_flags_to_adapter + run_without_connection do |orig_connection| + ActiveRecord::Base.establish_connection(orig_connection.merge({flags: Mysql2::Client::COMPRESS})) + assert_equal (Mysql2::Client::COMPRESS | Mysql2::Client::FOUND_ROWS), ActiveRecord::Base.connection.raw_connection.query_options[:flags] + end + end def test_mysql_strict_mode_specified_default run_without_connection do |orig_connection| |