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/lib | |
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/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb index 7ca597859d..6590e0140d 100644 --- a/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb @@ -10,9 +10,9 @@ module ActiveRecord config = config.symbolize_keys config[:username] = 'root' if config[:username].nil? - + config[:flags] ||= 0 if Mysql2::Client.const_defined? :FOUND_ROWS - config[:flags] = Mysql2::Client::FOUND_ROWS + config[:flags] |= Mysql2::Client::FOUND_ROWS end client = Mysql2::Client.new(config) |