Skip to content

Commit 0aa1ed9

Browse files
committed
Configure sqlite3 to use ~> 1.4 for rails 6+
1 parent 942e10f commit 0aa1ed9

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

Gemfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,13 @@ group :bench do
5353
end
5454

5555
group :test do
56-
gem 'sqlite3', '~> 1.3.13', platform: (@windows_platforms + [:ruby])
56+
platforms *(@windows_platforms + [:ruby]) do
57+
if version == 'master' || version >= '6'
58+
gem 'sqlite3', '~> 1.4'
59+
else
60+
gem 'sqlite3', '~> 1.3.13'
61+
end
62+
end
5763
platforms :jruby do
5864
if version == 'master' || version >= '5'
5965
gem 'activerecord-jdbcsqlite3-adapter', '~> 50'
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# frozen_string_literal: true
2+
3+
if RUBY_VERSION >= '2.6.0'
4+
if Rails::VERSION::MAJOR < 5
5+
class ActionController::TestResponse < ActionDispatch::TestResponse
6+
def recycle!
7+
# hack to avoid MonitorMixin double-initialize error:
8+
@mon_mutex_owner_object_id = nil
9+
@mon_mutex = nil
10+
initialize
11+
end
12+
end
13+
else
14+
puts "Monkeypatch for ActionController::TestResponse no longer needed"
15+
end
16+
end

test/test_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ def silence_warnings
5656

5757
require 'support/rails_app'
5858

59+
require 'support/ruby_2_6_rails_4_2_patch'
60+
5961
# require "rails/test_help"
6062

6163
require 'support/serialization_testing'

0 commit comments

Comments
 (0)