Configure sqlite3 to use ~> 1.4 for rails 6+

This commit is contained in:
Wasif Hossain 2019-04-22 23:22:28 +06:00
parent 942e10fdb8
commit 0aa1ed93a4
No known key found for this signature in database
GPG Key ID: 14C15A54E34D7803
3 changed files with 25 additions and 1 deletions

View File

@ -53,7 +53,13 @@ group :bench do
end
group :test do
gem 'sqlite3', '~> 1.3.13', platform: (@windows_platforms + [:ruby])
platforms *(@windows_platforms + [:ruby]) do
if version == 'master' || version >= '6'
gem 'sqlite3', '~> 1.4'
else
gem 'sqlite3', '~> 1.3.13'
end
end
platforms :jruby do
if version == 'master' || version >= '5'
gem 'activerecord-jdbcsqlite3-adapter', '~> 50'

View File

@ -0,0 +1,16 @@
# frozen_string_literal: true
if RUBY_VERSION >= '2.6.0'
if Rails::VERSION::MAJOR < 5
class ActionController::TestResponse < ActionDispatch::TestResponse
def recycle!
# hack to avoid MonitorMixin double-initialize error:
@mon_mutex_owner_object_id = nil
@mon_mutex = nil
initialize
end
end
else
puts "Monkeypatch for ActionController::TestResponse no longer needed"
end
end

View File

@ -56,6 +56,8 @@ end
require 'support/rails_app'
require 'support/ruby_2_6_rails_4_2_patch'
# require "rails/test_help"
require 'support/serialization_testing'