benchmark/proxy.rb in switch_point-0.8.0 vs benchmark/proxy.rb in switch_point-0.9.0
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
require 'benchmark/ips'
require 'switch_point'
require 'active_record'
SwitchPoint.configure do |config|
@@ -30,10 +32,10 @@
'proxy_writable' => database_config.dup,
}
ActiveRecord::Base.establish_connection(:default)
Plain.connection.execute('CREATE TABLE plains (id integer primary key autoincrement)')
-[:readonly, :writable].each do |mode|
+%i[readonly writable].each do |mode|
ProxyBase.public_send("with_#{mode}") do
%w[proxy1s proxy2s].each do |table|
ProxyBase.connection.execute("CREATE TABLE #{table} (id integer primary key autoincrement)")
end
end