Skip to content

Commit

Permalink
Remove activerecord dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
imjoehaines committed Dec 14, 2023
1 parent 1341a55 commit 54130a4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
1 change: 0 additions & 1 deletion features/fixtures/que/app/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ que_version = ENV.fetch("QUE_VERSION")
gem "que", "~> #{que_version}"

gem "pg", RUBY_VERSION < "2.2.0" ? "0.21.0" : "> 0.21.0"
gem "activerecord", RUBY_VERSION < "2.2.0" ? "4.2.11" : "> 4.2.11"

# Install a compatible Minitest version on Ruby <2.3
gem 'minitest', '5.11.3' if RUBY_VERSION < '2.3.0'
18 changes: 11 additions & 7 deletions features/fixtures/que/app/setup-que.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
require 'que'
require 'socket'
require 'bugsnag'
require 'active_record'

QUE_VERSION = ENV.fetch("QUE_VERSION")

Expand Down Expand Up @@ -30,15 +29,20 @@

raise 'postgres was not ready in time!' unless postgres_ready

ActiveRecord::Base.establish_connection(
adapter: 'postgresql',
database: 'postgres',
username: 'postgres',
connection = PG::Connection.open(
host: 'postgres',
user: 'postgres',
password: 'test_password',
host: 'postgres'
dbname: 'postgres'
)

Que.connection = ActiveRecord
if QUE_VERSION < '1'
Que.connection = connection
else
Que.connection_proc = do |block|
block.call(connection)
end
end

# Workaround a bug in que/pg
# see https://github.com/que-rb/que/issues/247
Expand Down

0 comments on commit 54130a4

Please sign in to comment.