Skip to content
This repository was archived by the owner on Apr 10, 2023. It is now read-only.

Commit d06e93d

Browse files
Merge pull request #204 from ixti/redmine_4.0.0
Support Redmine 4.0.0
2 parents 41926ed + 15e3564 commit d06e93d

22 files changed

+93
-576
lines changed

.travis.yml

Lines changed: 19 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,58 +5,43 @@ services:
55
- postgresql
66

77
rvm:
8-
- 2.2.8
9-
- 2.3.5
10-
- 2.4.2
8+
- 2.2.10
9+
- 2.3.8
10+
- 2.4.5
11+
- 2.5.3
1112

1213
matrix:
1314
allow_failures:
1415
# Master may fail for any reason, on any ruby version.
1516
# It's good to keep an eye on it in case if fails because of us.
16-
- rvm: 2.2.8
17+
- rvm: 2.2.10
1718
env: REDMINE_VER=master DB=mysql
18-
- rvm: 2.2.8
19-
env: REDMINE_VER=master DB=postgresql
20-
21-
- rvm: 2.3.5
19+
- rvm: 2.3.8
2220
env: REDMINE_VER=master DB=mysql
23-
- rvm: 2.3.5
24-
env: REDMINE_VER=master DB=postgresql
25-
26-
# Redmine < 3.4 does not work with ruby 2.4.
27-
- rvm: 2.4.2
28-
env: REDMINE_VER=3.2.8 DB=mysql
29-
- rvm: 2.4.2
30-
env: REDMINE_VER=3.3.5 DB=mysql
31-
- rvm: 2.4.2
21+
- rvm: 2.4.5
3222
env: REDMINE_VER=master DB=mysql
33-
34-
- rvm: 2.4.2
35-
env: REDMINE_VER=3.2.8 DB=postgresql
36-
- rvm: 2.4.2
37-
env: REDMINE_VER=3.3.5 DB=postgresql
38-
- rvm: 2.4.2
23+
- rvm: 2.5.3
24+
env: REDMINE_VER=master DB=mysql
25+
- rvm: 2.2.10
26+
env: REDMINE_VER=master DB=postgresql
27+
- rvm: 2.3.8
28+
env: REDMINE_VER=master DB=postgresql
29+
- rvm: 2.4.5
30+
env: REDMINE_VER=master DB=postgresql
31+
- rvm: 2.5.3
3932
env: REDMINE_VER=master DB=postgresql
40-
41-
gemfile:
42-
- $REDMINE_PATH/Gemfile
4333

4434
env:
45-
- REDMINE_VER=3.2.8 DB=mysql
46-
- REDMINE_VER=3.3.5 DB=mysql
47-
- REDMINE_VER=3.4.3 DB=mysql
48-
- REDMINE_VER=3.2.8 DB=postgresql
49-
- REDMINE_VER=3.3.5 DB=postgresql
50-
- REDMINE_VER=3.4.3 DB=postgresql
35+
- REDMINE_VER=4.0.0 DB=mysql
36+
- REDMINE_VER=4.0.0 DB=postgresql
5137
- REDMINE_VER=master DB=mysql
5238
- REDMINE_VER=master DB=postgresql
5339

5440
before_install:
5541
- export PLUGIN_NAME=redmine_tags
5642
- export REDMINE_PATH=$HOME/redmine
43+
- export BUNDLE_GEMFILE=$REDMINE_PATH/Gemfile
5744
- git clone https://github.com/redmine/redmine.git --branch $REDMINE_VER --depth 1 $REDMINE_PATH
58-
# TODO: This plugin has to go!
59-
- git clone https://github.com/ZitecCOM/redmine_testing_gems.git --branch 1.3.3 --depth 1 $REDMINE_PATH/plugins/redmine_testing_gems
6045
# TODO: this needs to be a `mv` once the testing plugin is removed.
6146
- ln -s $TRAVIS_BUILD_DIR $REDMINE_PATH/plugins/$PLUGIN_NAME
6247
- cp config/database-$DB-travis.yml $REDMINE_PATH/config/database.yml

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
gem 'acts-as-taggable-on', '~> 4.0'
1+
gem 'acts-as-taggable-on'

Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
.PHONY: ci
88
ci:
99
@rake redmine:plugins:test RAILS_ENV=test NAME=redmine_tags
10-
@rake redmine:plugins:spec RAILS_ENV=test NAME=redmine_tags
1110

1211
# Prepares the database.
1312
#
@@ -17,5 +16,4 @@ ci:
1716
# ```
1817
.PHONY: prepare
1918
prepare:
20-
@echo "config.active_record.schema_format = :sql" >> config/additional_environment.rb
21-
@rake db:create db:migrate redmine:plugins:migrate db:structure:dump
19+
@rake db:create db:migrate redmine:plugins:migrate

README.md

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
Allows marking up different models in Redmine with tags.
66
Inspired by original `redmine_tags` of Eric Davis.
77

8+
## Important news
9+
**This plugin is EOL** and all my efforts will be pointed to move the current features to the Redmine core. Please see http://www.redmine.org/issues/1448 for more details or to track the progress. I will continue to accept/implement only bug fixes and future Redmine versions.
810

911
## Supported models
1012

@@ -14,8 +16,8 @@ Inspired by original `redmine_tags` of Eric Davis.
1416

1517
## Requirements
1618

17-
- Ruby `>= 2.1.9`
18-
- Redmine `>= 3.1.7`
19+
- Ruby `>= 2.2.10`
20+
- Redmine `>= 4.0.0`
1921

2022

2123
## Installing
@@ -42,23 +44,14 @@ Inspired by original `redmine_tags` of Eric Davis.
4244
Make sure you have the latest database structure loaded to the test database:
4345
4446
```
45-
rake db:structure:dump
46-
rake db:drop db:create db:structure:load RAILS_ENV=test
47-
```
48-
49-
You need to have the
50-
[redmine_testing_gems](https://github.com/ZitecCOM/redmine_testing_gems)
51-
plugin:
5247

53-
```
54-
git clone https://github.com/ZitecCOM/redmine_testing_gems.git --branch 1.3.1
55-
bundle install
48+
rake db:drop db:create db:migrate RAILS_ENV=test
5649
```
5750
58-
After you cloned the plugin, run the follwing command:
51+
After you cloned the plugin, run the following command:
5952
6053
```
61-
rake redmine:plugins:spec RAILS_ENV=test NAME=redmine_tags
54+
rake redmine:plugins:test RAILS_ENV=test NAME=redmine_tags
6255
```
6356
6457

db/migrate/20151209153801_acts_as_taggable_migration.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class ActsAsTaggableMigration < ActiveRecord::Migration
1+
class ActsAsTaggableMigration < ActiveRecord::Migration[4.2]
22
def up
33
# ActsAsTaggableOnMigration
44
unless table_exists?(:tags)

db/migrate/20180122193833_remove_wrong_tag_list_journals.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class RemoveWrongTagListJournals < ActiveRecord::Migration
1+
class RemoveWrongTagListJournals < ActiveRecord::Migration[4.2]
22
def change
33
# First, remove from journal details the tag changes where the new value is the same with the old_value
44
JournalDetail.where("prop_key = 'tag_list' AND old_value = value").destroy_all

init.rb

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22

33
require 'redmine_tags'
44

5-
# ActiveSupport::Reloader for rails >= 5
6-
# ActionDispatch::Callbacks for rails < 5
7-
reloader = defined?(ActiveSupport::Reloader) ? ActiveSupport::Reloader : ActionDispatch::Callbacks
8-
9-
reloader.to_prepare do
5+
ActiveSupport::Reloader.to_prepare do
106
paths = '/lib/redmine_tags/{patches/*_patch,hooks/*_hook}.rb'
117
Dir.glob(File.dirname(__FILE__) + paths).each do |file|
128
require_dependency file
@@ -17,11 +13,11 @@
1713
name 'Redmine Tags'
1814
author 'Aleksey V Zapparov AKA "ixti"'
1915
description 'Redmine tagging support'
20-
version '3.2.2'
16+
version '4.0.0'
2117
url 'https://github.com/ixti/redmine_tags/'
2218
author_url 'http://www.ixti.net/'
2319

24-
requires_redmine version_or_higher: '3.0.0'
20+
requires_redmine version_or_higher: '4.0.0'
2521

2622
settings \
2723
default: {
@@ -33,20 +29,3 @@
3329
},
3430
partial: 'tags/settings'
3531
end
36-
37-
Rails.application.config.after_initialize do
38-
test_dependencies = {
39-
# TODO: do not depend on this for tests.
40-
redmine_testing_gems: '1.3.3'
41-
}
42-
current_plugin = Redmine::Plugin.find(:redmine_tags)
43-
check_dependencies = proc do |plugin, version|
44-
begin
45-
current_plugin.requires_redmine_plugin(plugin, version)
46-
rescue Redmine::PluginNotFound
47-
raise Redmine::PluginNotFound,
48-
"Redmine Tags depends on plugin: #{plugin} version: #{version}"
49-
end
50-
end
51-
test_dependencies.each(&check_dependencies) if Rails.env.test?
52-
end

lib/redmine_tags/patches/issue_patch.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ def self.included(base)
88
acts_as_ordered_taggable
99

1010
safe_attributes 'tag_list'
11-
alias_method_chain :copy_from, :redmine_tags
11+
alias_method :copy_from_without_redmine_tags, :copy_from
12+
alias_method :copy_from, :copy_from_with_redmine_tags
1213

1314
searchable_options[:columns] << "tags.name"
1415
searchable_options[:preload] << :tags

lib/redmine_tags/patches/issue_query_patch.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ module IssueQueryPatch
44
def self.included(base)
55
base.send :include, InstanceMethods
66
base.class_eval do
7-
unloadable
7+
alias_method :available_filters_without_tags, :available_filters
8+
alias_method :available_filters, :available_filters_with_tags
89

9-
alias_method_chain :available_filters, :tags
10-
alias_method_chain :available_columns, :tags
10+
alias_method :available_columns_without_tags, :available_columns
11+
alias_method :available_columns, :available_columns_with_tags
1112
end
1213
end
1314

spec/controllers/add_helpers_for_issue_tags_patch_spec.rb

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)