aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2016-11-10 16:13:30 +0900
committerAkira Matsuda <ronnie@dio.jp>2016-11-10 16:13:30 +0900
commitd7b333469e347824a9b2302da674d557277014d1 (patch)
treeac06ae7c191b5bf7e4f9762a6ef39ee1c4977ca4 /activerecord
parent1b16e4c348055e9e7909e59e47dbe346b149ba52 (diff)
downloadrails-d7b333469e347824a9b2302da674d557277014d1.tar.gz
rails-d7b333469e347824a9b2302da674d557277014d1.tar.bz2
rails-d7b333469e347824a9b2302da674d557277014d1.zip
Mysql2::Client::FOUND_ROWS should be defined in all currently supported versions of mysql2
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb
index a3e2c913c5..45e400b75b 100644
--- a/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb
@@ -14,12 +14,10 @@ module ActiveRecord
config[:username] = "root" if config[:username].nil?
config[:flags] ||= 0
- if Mysql2::Client.const_defined? :FOUND_ROWS
- if config[:flags].kind_of? Array
- config[:flags].push "FOUND_ROWS".freeze
- else
- config[:flags] |= Mysql2::Client::FOUND_ROWS
- end
+ if config[:flags].kind_of? Array
+ config[:flags].push "FOUND_ROWS".freeze
+ else
+ config[:flags] |= Mysql2::Client::FOUND_ROWS
end
client = Mysql2::Client.new(config)