diff --git a/.circleci/config.yml b/.circleci/config.yml index 8fd2e9b..b80064f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,9 +1,41 @@ version: 2.1 orbs: - redmine-plugin: agileware-jp/redmine-plugin@3.6.1 + redmine-plugin: agileware-jp/redmine-plugin@3.7.0 jobs: + rspec-git-url: + parameters: + redmine_git_url: + type: string + redmine_version: + type: string + ruby_version: + type: string + db: + type: enum + enum: ['mysql', 'pg'] + db_version: + type: string + executor: + name: redmine-plugin/ruby-<< parameters.db >> + ruby_version: << parameters.ruby_version >> + db_version: << parameters.db_version >> + steps: + - checkout + - redmine-plugin/download-redmine-git-url: + git_url: << parameters.redmine_git_url >> + version: << parameters.redmine_version >> + - redmine-plugin/install-self + - redmine-plugin/generate-database_yml + - redmine-plugin/bundle-install + - redmine-plugin/migrate-without-plugins + - run: sudo apt-get install fonts-migmix + - redmine-plugin/rspec: + test_migration_rollback: false + - store_artifacts: + path: redmine/tmp/capybara + destination: screenshots rspec: parameters: redmine_version: @@ -47,6 +79,15 @@ workflows: version: 2 test: jobs: + - rspec-git-url: + <<: *default_context + <<: *ignore_trial + name: RSpec on Redmine git with PostgreSQL + redmine_git_url: $REDMINE_GIT_URL + redmine_version: $REDMINE_GIT_REVISION + ruby_version: $REDMINE_GIT_RUBY_VERSION + db: pg + db_version: $POSTGRES_VERSION - rspec: <<: *default_context <<: *ignore_trial diff --git a/app/models/trashed_custom_value.rb b/app/models/trashed_custom_value.rb index 712fcb7..fc87484 100644 --- a/app/models/trashed_custom_value.rb +++ b/app/models/trashed_custom_value.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class TrashedCustomValue < ActiveRecord::Base +class TrashedCustomValue < defined?(ApplicationRecord) == 'constant' ? ApplicationRecord : ActiveRecord::Base belongs_to :trashed_issue acts_as_attachable view_permission: :view_files diff --git a/app/models/trashed_issue.rb b/app/models/trashed_issue.rb index 2db9665..3e20000 100644 --- a/app/models/trashed_issue.rb +++ b/app/models/trashed_issue.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class TrashedIssue < ActiveRecord::Base +class TrashedIssue < defined?(ApplicationRecord) == 'constant' ? ApplicationRecord : ActiveRecord::Base belongs_to :project has_many :trashed_custom_values, dependent: :destroy belongs_to :deleted_by, class_name: 'User'