Skip to content

Commit

Permalink
remove deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
seuros committed Oct 14, 2023
1 parent 6508e05 commit e5e8de7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
6 changes: 0 additions & 6 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,4 @@ appraise 'activerecord-7.1' do
gem 'activerecord', '~> 7.1.0'
gem 'pg'
gem 'mysql2', '~> 0.5'
end

appraise 'activerecord-7.1' do
gem 'activerecord', '~> 7.1.0'
gem 'pg'
gem 'trilogy'
end
2 changes: 1 addition & 1 deletion gemfiles/activerecord_7.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ source "https://rubygems.org"

gem "activerecord", "~> 7.1.0"
gem "pg"
gem "trilogy"
gem "mysql2", "~> 0.5"

group :local_development do
gem "guard"
Expand Down
8 changes: 2 additions & 6 deletions spec/support/database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,14 @@
else
ActiveRecord::Base.default_timezone = :utc
end
config = if ActiveRecord.version >= Gem::Version.new('6.1.0')
ActiveRecord::Base.configurations.configs_for(env_name: db_name)
else
ActiveSupport::HashWithIndifferentAccess.new(ActiveRecord::Base.configurations[db_name])
end
config = ActiveRecord::Base.configurations.configs_for(env_name: db_name)

begin
ActiveRecord::Base.establish_connection(db_name.to_sym)
ActiveRecord::Base.connection
rescue StandardError
case db_name
when /mysql/
when /(mysql)/
ActiveRecord::Base.establish_connection(config.merge('database' => nil))
ActiveRecord::Base.connection.create_database(config['database'],
{ charset: 'utf8', collation: 'utf8_unicode_ci' })
Expand Down

0 comments on commit e5e8de7

Please sign in to comment.