From b784bdf37143161bcb47657206deee09f929661f Mon Sep 17 00:00:00 2001 From: Roberto Piccini Date: Fri, 30 Aug 2019 15:09:24 +0200 Subject: [PATCH 1/5] upgrade redmine from 3 to 4 --- app/controllers/custom_reports_controller.rb | 10 +++++----- app/models/custom_report_series.rb | 2 +- db/migrate/20121212125001_create_custom_reports.rb | 2 +- .../20121212125002_create_custom_report_series.rb | 2 +- ...0121212125003_remove_filters_from_custom_reports.rb | 2 +- lib/redmine_custom_reports.rb | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/controllers/custom_reports_controller.rb b/app/controllers/custom_reports_controller.rb index 7b53775..ebb41b9 100644 --- a/app/controllers/custom_reports_controller.rb +++ b/app/controllers/custom_reports_controller.rb @@ -1,11 +1,11 @@ class CustomReportsController < ApplicationController unloadable - before_filter :find_project_by_project_id - before_filter :authorize - before_filter :find_custom_reports, only: [:index, :show, :new, :edit] - before_filter :find_custom_report, only: [:show, :edit, :update, :destroy] - before_filter :authorize_to_manage, only: [:edit, :update, :destroy] + before_action :find_project_by_project_id + before_action :authorize + before_action :find_custom_reports, only: [:index, :show, :new, :edit] + before_action :find_custom_report, only: [:show, :edit, :update, :destroy] + before_action :authorize_to_manage, only: [:edit, :update, :destroy] helper :queries include QueriesHelper diff --git a/app/models/custom_report_series.rb b/app/models/custom_report_series.rb index 01f550e..8650343 100644 --- a/app/models/custom_report_series.rb +++ b/app/models/custom_report_series.rb @@ -3,7 +3,7 @@ class CustomReportSeries < ActiveRecord::Base serialize :filters - belongs_to :custom_report, inverse_of: :series + belongs_to :custom_report, inverse_of: :series, optional: true validates :name, presence: true diff --git a/db/migrate/20121212125001_create_custom_reports.rb b/db/migrate/20121212125001_create_custom_reports.rb index 0f4d54f..514c744 100644 --- a/db/migrate/20121212125001_create_custom_reports.rb +++ b/db/migrate/20121212125001_create_custom_reports.rb @@ -1,4 +1,4 @@ -class CreateCustomReports < ActiveRecord::Migration +class CreateCustomReports < ActiveRecord::Migration[4.2] def self.up unless table_exists? :custom_reports create_table :custom_reports do |t| diff --git a/db/migrate/20121212125002_create_custom_report_series.rb b/db/migrate/20121212125002_create_custom_report_series.rb index 9f06771..ed2fcee 100644 --- a/db/migrate/20121212125002_create_custom_report_series.rb +++ b/db/migrate/20121212125002_create_custom_report_series.rb @@ -1,4 +1,4 @@ -class CreateCustomReportSeries < ActiveRecord::Migration +class CreateCustomReportSeries < ActiveRecord::Migration[4.2] def self.up unless table_exists? :custom_report_series create_table :custom_report_series do |t| diff --git a/db/migrate/20121212125003_remove_filters_from_custom_reports.rb b/db/migrate/20121212125003_remove_filters_from_custom_reports.rb index ea25177..ae2baa9 100644 --- a/db/migrate/20121212125003_remove_filters_from_custom_reports.rb +++ b/db/migrate/20121212125003_remove_filters_from_custom_reports.rb @@ -1,4 +1,4 @@ -class RemoveFiltersFromCustomReports < ActiveRecord::Migration +class RemoveFiltersFromCustomReports < ActiveRecord::Migration[4.2] def self.up if column_exists? :custom_reports, :filters remove_column :custom_reports, :filters diff --git a/lib/redmine_custom_reports.rb b/lib/redmine_custom_reports.rb index 1a15c5f..553ee10 100644 --- a/lib/redmine_custom_reports.rb +++ b/lib/redmine_custom_reports.rb @@ -1,4 +1,4 @@ -ActionDispatch::Callbacks.to_prepare do +ActiveSupport::Reloader.to_prepare do # Requiring plugin's controller and model require_dependency 'custom_report' From f4525f1f3ea40b8316959229156cf8c55a3e68ff Mon Sep 17 00:00:00 2001 From: Roberto Piccini Date: Fri, 6 Sep 2019 15:36:45 +0200 Subject: [PATCH 2/5] bugfix: belongs_to required by default only in new apps --- app/models/custom_report_series.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/custom_report_series.rb b/app/models/custom_report_series.rb index 8650343..01f550e 100644 --- a/app/models/custom_report_series.rb +++ b/app/models/custom_report_series.rb @@ -3,7 +3,7 @@ class CustomReportSeries < ActiveRecord::Base serialize :filters - belongs_to :custom_report, inverse_of: :series, optional: true + belongs_to :custom_report, inverse_of: :series validates :name, presence: true From 234236e07885096937d99b259555cd1b2f55b2a5 Mon Sep 17 00:00:00 2001 From: Roberto Piccini Date: Sat, 7 Sep 2019 21:43:30 +0200 Subject: [PATCH 3/5] update travis --- .travis.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.travis.yml b/.travis.yml index 2ace80f..11e3b45 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,10 +14,20 @@ env: - REDMINE_VER=3.1.6 DB=mysql - REDMINE_VER=3.2.3 DB=mysql - REDMINE_VER=3.3.0 DB=mysql + - REDMINE_VER=4.0.0 DB=mysql + - REDMINE_VER=4.0.1 DB=mysql + - REDMINE_VER=4.0.2 DB=mysql + - REDMINE_VER=4.0.3 DB=mysql + - REDMINE_VER=4.0.4 DB=mysql - REDMINE_VER=3.1.6 DB=postgresql - REDMINE_VER=3.2.3 DB=postgresql - REDMINE_VER=3.3.0 DB=postgresql + - REDMINE_VER=4.0.0 DB=postgresql + - REDMINE_VER=4.0.1 DB=postgresql + - REDMINE_VER=4.0.2 DB=postgresql + - REDMINE_VER=4.0.3 DB=postgresql + - REDMINE_VER=4.0.4 DB=postgresql before_install: - export PLUGIN_NAME=redmine_custom_reports From eb3a1bad303611518f0bda6796fb7f3dc23aa042 Mon Sep 17 00:00:00 2001 From: Roberto Piccini Date: Sat, 7 Sep 2019 21:48:24 +0200 Subject: [PATCH 4/5] bugfix: #234236e --- .travis.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 11e3b45..bd2b74f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,18 +11,12 @@ gemfile: - $REDMINE_PATH/Gemfile env: - - REDMINE_VER=3.1.6 DB=mysql - - REDMINE_VER=3.2.3 DB=mysql - - REDMINE_VER=3.3.0 DB=mysql - REDMINE_VER=4.0.0 DB=mysql - REDMINE_VER=4.0.1 DB=mysql - REDMINE_VER=4.0.2 DB=mysql - REDMINE_VER=4.0.3 DB=mysql - REDMINE_VER=4.0.4 DB=mysql - - REDMINE_VER=3.1.6 DB=postgresql - - REDMINE_VER=3.2.3 DB=postgresql - - REDMINE_VER=3.3.0 DB=postgresql - REDMINE_VER=4.0.0 DB=postgresql - REDMINE_VER=4.0.1 DB=postgresql - REDMINE_VER=4.0.2 DB=postgresql @@ -38,9 +32,9 @@ before_install: - cd $REDMINE_PATH before_script: - - bundle exec rake db:create - - bundle exec rake db:migrate - - bundle exec rake redmine:plugins:migrate + - bundle exec rails db:create + - bundle exec rails db:migrate + - bundle exec rails redmine:plugins:migrate script: - bundle exec ruby plugins/$PLUGIN_NAME/test/**/*_test.rb From bf0ce2586c4a820bc323926430970b67a0935a74 Mon Sep 17 00:00:00 2001 From: Roberto Piccini Date: Sat, 7 Sep 2019 22:03:11 +0200 Subject: [PATCH 5/5] bugfix: #234236e (another attempt) --- .travis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bd2b74f..9a6e0fc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,11 @@ services: - postgresql rvm: - - 2.2.0 + - 2.2.2 + - 2.3 + - 2.4 + - 2.5 + - 2.6 gemfile: - $REDMINE_PATH/Gemfile