Skip to content

Commit

Permalink
Merge pull request #205 from collectiveidea/dg-fixup-rails-7-0
Browse files Browse the repository at this point in the history
Finish rails 7 support
  • Loading branch information
albus522 authored Jan 18, 2022
2 parents d65b0f9 + 7bd1abb commit 3a3e5ee
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 42 deletions.
127 changes: 88 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,98 +12,147 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [2.5, 2.6, 2.7, jruby]
ruby: ['2.7', '3.0', '3.1', 'jruby-9.3']
gemfile:
- gemfiles/mysql2/5-2.gemfile
- gemfiles/postgresql/5-2.gemfile
- gemfiles/sqlite3/5-2.gemfile
- gemfiles/mysql2/6-0.gemfile
- gemfiles/postgresql/6-0.gemfile
- gemfiles/sqlite3/6-0.gemfile
- gemfiles/mysql2/6-1.gemfile
- gemfiles/postgresql/6-1.gemfile
- gemfiles/sqlite3/6-1.gemfile
- gemfiles/mysql2/7-0.gemfile
- gemfiles/postgresql/7-0.gemfile
- gemfiles/sqlite3/7-0.gemfile
include:
#
# The future
#
# Active Record head
- ruby: 2.6
- ruby: '2.7'
gemfile: gemfiles/mysql2/master.gemfile
- ruby: 2.6
- ruby: '2.7'
gemfile: gemfiles/postgresql/master.gemfile
- ruby: 2.6
- ruby: '2.7'
gemfile: gemfiles/sqlite3/master.gemfile
- ruby: 2.7
- ruby: '3.0'
gemfile: gemfiles/mysql2/master.gemfile
- ruby: 2.7
- ruby: '3.0'
gemfile: gemfiles/postgresql/master.gemfile
- ruby: 2.7
- ruby: '3.0'
gemfile: gemfiles/sqlite3/master.gemfile
- ruby: '3.1'
gemfile: gemfiles/mysql2/master.gemfile
- ruby: '3.1'
gemfile: gemfiles/postgresql/master.gemfile
- ruby: '3.1'
gemfile: gemfiles/sqlite3/master.gemfile
# MRI Ruby head
- ruby: head
gemfile: gemfiles/mysql2/6-1.gemfile
gemfile: gemfiles/mysql2/master.gemfile
- ruby: head
gemfile: gemfiles/postgresql/6-1.gemfile
gemfile: gemfiles/postgresql/master.gemfile
- ruby: head
gemfile: gemfiles/sqlite3/6-1.gemfile
gemfile: gemfiles/sqlite3/master.gemfile
- ruby: head
gemfile: gemfiles/mysql2/7-0.gemfile
- ruby: head
gemfile: gemfiles/postgresql/7-0.gemfile
- ruby: head
gemfile: gemfiles/sqlite3/7-0.gemfile
# JRuby head
- ruby: jruby-head
gemfile: gemfiles/mysql2/6-1.gemfile
- ruby: jruby-head
gemfile: gemfiles/postgresql/6-1.gemfile
- ruby: jruby-head
gemfile: gemfiles/sqlite3/6-1.gemfile

#
# Current
#
# MRI Ruby 2.6
- ruby: '2.6'
gemfile: gemfiles/mysql2/6-0.gemfile
- ruby: '2.6'
gemfile: gemfiles/postgresql/6-0.gemfile
- ruby: '2.6'
gemfile: gemfiles/sqlite3/6-0.gemfile
- ruby: '2.6'
gemfile: gemfiles/mysql2/6-1.gemfile
- ruby: '2.6'
gemfile: gemfiles/postgresql/6-1.gemfile
- ruby: '2.6'
gemfile: gemfiles/sqlite3/6-1.gemfile
# Rails 5.2
- ruby: '2.6'
gemfile: gemfiles/mysql2/5-2.gemfile
- ruby: '2.6'
gemfile: gemfiles/postgresql/5-2.gemfile
- ruby: '2.6'
gemfile: gemfiles/sqlite3/5-2.gemfile
- ruby: '2.7'
gemfile: gemfiles/mysql2/5-2.gemfile
- ruby: '2.7'
gemfile: gemfiles/postgresql/5-2.gemfile
- ruby: '2.7'
gemfile: gemfiles/sqlite3/5-2.gemfile
- ruby: 'jruby-9.2'
gemfile: gemfiles/mysql2/5-2.gemfile
- ruby: 'jruby-9.2'
gemfile: gemfiles/postgresql/5-2.gemfile
- ruby: 'jruby-9.2'
gemfile: gemfiles/sqlite3/5-2.gemfile

#
# The past
#
# EOL Active Record
# Rails 3.2 was maintained longer and is ruby 2.2 compatible
- ruby: 2.2
- ruby: '2.2'
gemfile: gemfiles/postgresql/3-2.gemfile
- ruby: 2.2
- ruby: '2.2'
gemfile: gemfiles/sqlite3/3-2.gemfile
# Rails <= 4.0 was only compatible with ruby 2.0
# The test were running, but there are known incompatibilites
# (Isn't supported on Github Actions)
# - rvm: 2.0.0-p648
# gemfile: gemfiles/postgresql/3-0.gemfile
# - rvm: 2.0.0-p648
# gemfile: gemfiles/sqlite3/3-0.gemfile
# - rvm: 2.0.0-p648
# gemfile: gemfiles/postgresql/3-1.gemfile
# - rvm: 2.0.0-p648
# gemfile: gemfiles/sqlite3/3-1.gemfile
# - rvm: 2.0.0-p648
# gemfile: gemfiles/postgresql/4-0.gemfile
# - rvm: 2.0.0-p648
# gemfile: gemfiles/sqlite3/4-0.gemfile
- ruby: 2.0.0
gemfile: gemfiles/postgresql/3-0.gemfile
- ruby: 2.0.0
gemfile: gemfiles/sqlite3/3-0.gemfile
- ruby: 2.0.0
gemfile: gemfiles/postgresql/3-1.gemfile
- ruby: 2.0.0
gemfile: gemfiles/sqlite3/3-1.gemfile
- ruby: 2.0.0
gemfile: gemfiles/postgresql/4-0.gemfile
- ruby: 2.0.0
gemfile: gemfiles/sqlite3/4-0.gemfile
# Rails 4.1 was only compatible with ruby 2.1
- ruby: 2.1
- ruby: '2.1'
gemfile: gemfiles/postgresql/4-1.gemfile
- ruby: 2.1
- ruby: '2.1'
gemfile: gemfiles/sqlite3/4-1.gemfile
# Rails 4.2 was EOL with the release of 6.0 and compatible with ruby 2.4
- ruby: 2.4
- ruby: '2.4'
gemfile: gemfiles/mysql2/4-2.gemfile
- ruby: 2.4
- ruby: '2.4'
gemfile: gemfiles/postgresql/4-2.gemfile
- ruby: 2.4
- ruby: '2.4'
gemfile: gemfiles/sqlite3/4-2.gemfile
# Rails 5.0 was EOL with the release of 5.2 and compatible with ruby 2.4
- ruby: 2.4
- ruby: '2.4'
gemfile: gemfiles/mysql2/5-0.gemfile
- ruby: 2.4
- ruby: '2.4'
gemfile: gemfiles/postgresql/5-0.gemfile
- ruby: 2.4
- ruby: '2.4'
gemfile: gemfiles/sqlite3/5-0.gemfile
# Rails 5.1 was EOL with the release of 6.0 and compatible with ruby 2.5
- ruby: 2.5
- ruby: '2.5'
gemfile: gemfiles/mysql2/5-1.gemfile
- ruby: 2.5
- ruby: '2.5'
gemfile: gemfiles/postgresql/5-1.gemfile
- ruby: 2.5
- ruby: '2.5'
gemfile: gemfiles/sqlite3/5-1.gemfile

#
# The parallel dimension
#
Expand Down
3 changes: 2 additions & 1 deletion delayed_job_active_record.gemspec
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# frozen_string_literal: true

Gem::Specification.new do |spec|
spec.add_dependency "activerecord", [">= 3.0", "< 6.2"]
spec.add_dependency "activerecord", [">= 3.0", "< 8.0"]
spec.add_dependency "delayed_job", [">= 3.0", "< 5"]
spec.authors = ["Brian Ryckbost", "Matt Griffin", "Erik Michaels-Ober"]
spec.description = "ActiveRecord backend for Delayed::Job, originally authored by Tobias Lütke"
spec.email = ["[email protected]", "[email protected]", "[email protected]"]
spec.files = %w[CONTRIBUTING.md LICENSE.md README.md delayed_job_active_record.gemspec] + Dir["lib/**/*.rb"]
spec.homepage = "http://github.com/collectiveidea/delayed_job_active_record"
spec.licenses = ["MIT"]
spec.metadata = { "rubygems_mfa_required" => "true" }
spec.name = "delayed_job_active_record"
spec.require_paths = ["lib"]
spec.summary = "ActiveRecord backend for DelayedJob"
Expand Down
19 changes: 19 additions & 0 deletions gemfiles/mysql2/7-0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "rake"

group :test do
platforms :ruby, :mswin, :mingw do
gem "mysql2", "~> 0.5"
end

gem "rspec", ">= 2.11"
gem "simplecov", ">= 0.20.0", require: false
gem "simplecov-lcov", ">= 0.8.0", require: false

gem "activerecord", "~> 7.0.1"
end

gemspec path: "../../"
19 changes: 19 additions & 0 deletions gemfiles/postgresql/7-0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "rake"

group :test do
platforms :ruby, :mswin, :mingw do
gem "pg", "~> 1.1"
end

gem "rspec", ">= 2.11"
gem "simplecov", ">= 0.20.0", require: false
gem "simplecov-lcov", ">= 0.8.0", require: false

gem "activerecord", "~> 7.0.1"
end

gemspec path: "../../"
19 changes: 19 additions & 0 deletions gemfiles/sqlite3/7-0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "rake"

group :test do
platforms :ruby, :mswin, :mingw do
gem "sqlite3", "~> 1.4"
end

gem "rspec", ">= 2.11"
gem "simplecov", ">= 0.20.0", require: false
gem "simplecov-lcov", ">= 0.8.0", require: false

gem "activerecord", "~> 7.0.1"
end

gemspec path: "../../"
4 changes: 2 additions & 2 deletions spec/delayed/serialization/active_record_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
describe ActiveRecord do
it "loads classes with non-default primary key" do
expect do
YAML.load(Story.create.to_yaml)
YAML.load_dj(Story.create.to_yaml)
end.not_to raise_error
end

it "loads classes even if not in default scope" do
expect do
YAML.load(Story.create(scoped: false).to_yaml)
YAML.load_dj(Story.create(scoped: false).to_yaml)
end.not_to raise_error
end
end

0 comments on commit 3a3e5ee

Please sign in to comment.