From 48dc30a55704518a2d6102ca1bd5cadbdc84d9e4 Mon Sep 17 00:00:00 2001 From: Alexander Meindl Date: Wed, 31 Jan 2024 08:52:15 +0100 Subject: [PATCH] Support rails 7 --- .github/workflows/tests.yml | 2 +- test/redmine/models/issue.rb | 2 +- test/redmine/models/project.rb | 2 +- test/redmine/models/user.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fae5c30..20458ed 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,7 +5,7 @@ on: jobs: test: - name: ${{ matrix.redmine }} ${{ matrix.db }} ruby-${{ matrix.ruby }} + name: ruby-${{ matrix.ruby }} runs-on: ubuntu-latest strategy: diff --git a/test/redmine/models/issue.rb b/test/redmine/models/issue.rb index b7e5b56..be89f53 100644 --- a/test/redmine/models/issue.rb +++ b/test/redmine/models/issue.rb @@ -3,7 +3,7 @@ require_relative 'project' require_relative 'user' -class Issue < ActiveRecord::Base +class Issue < Rails.version < '7.1' ? ActiveRecord::Base : ApplicationRecord belongs_to :project belongs_to :user belongs_to :author, class_name: 'User' diff --git a/test/redmine/models/project.rb b/test/redmine/models/project.rb index 13ea3a5..f1c4f1c 100644 --- a/test/redmine/models/project.rb +++ b/test/redmine/models/project.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class Project < ActiveRecord::Base +class Project < Rails.version < '7.1' ? ActiveRecord::Base : ApplicationRecord STATUS_ACTIVE = 1 has_many :issues, dependent: :destroy diff --git a/test/redmine/models/user.rb b/test/redmine/models/user.rb index 5a91274..aa98edb 100644 --- a/test/redmine/models/user.rb +++ b/test/redmine/models/user.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class User < ActiveRecord::Base +class User < Rails.version < '7.1' ? ActiveRecord::Base : ApplicationRecord has_many :issues def self.current