Skip to content

Commit

Permalink
Drop support for Rails 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
janko committed Dec 25, 2024
1 parent 95d6037 commit c7331cc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
14 changes: 4 additions & 10 deletions lib/sequel/extensions/activerecord_connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -194,18 +194,12 @@ def with_activerecord_connection
# Active Record doesn't guarantee that a single connection can only be used
# by one thread at a time, so we need to use locking, which is what Active
# Record does internally as well.
if ActiveRecord.version >= Gem::Version.new("5.1")
def activerecord_lock
activerecord_connection.lock.synchronize do
ActiveSupport::Dependencies.interlock.permit_concurrent_loads do
yield
end
def activerecord_lock
activerecord_connection.lock.synchronize do
ActiveSupport::Dependencies.interlock.permit_concurrent_loads do
yield
end
end
else
def activerecord_lock
yield
end
end

def activerecord_connection
Expand Down
2 changes: 1 addition & 1 deletion sequel-activerecord_connection.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
spec.required_ruby_version = ">= 2.5"

spec.add_dependency "sequel", "~> 5.38"
spec.add_dependency "activerecord", ">= 5.0", "< 8.1"
spec.add_dependency "activerecord", ">= 5.1", "< 8.1"

spec.add_development_dependency "sequel_pg" unless RUBY_ENGINE == "jruby"
spec.add_development_dependency "minitest"
Expand Down
2 changes: 1 addition & 1 deletion test/extension_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
q2.pop

[thread1, thread2].each(&:join)
end unless ActiveRecord.version < Gem::Version.new("5.1") || ActiveRecord.version >= Gem::Version.new("7.2")
end unless ActiveRecord.version >= Gem::Version.new("7.2")

it "checks the expected connection class" do
db = Sequel.connect "sqlite://",
Expand Down

0 comments on commit c7331cc

Please sign in to comment.