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

Commit

Permalink
Merge pull request #204 from ixti/redmine_4.0.0
Browse files Browse the repository at this point in the history
Support Redmine 4.0.0
  • Loading branch information
marius-balteanu authored Dec 9, 2018
2 parents 41926ed + 15e3564 commit d06e93d
Show file tree
Hide file tree
Showing 22 changed files with 93 additions and 576 deletions.
53 changes: 19 additions & 34 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,58 +5,43 @@ services:
- postgresql

rvm:
- 2.2.8
- 2.3.5
- 2.4.2
- 2.2.10
- 2.3.8
- 2.4.5
- 2.5.3

matrix:
allow_failures:
# Master may fail for any reason, on any ruby version.
# It's good to keep an eye on it in case if fails because of us.
- rvm: 2.2.8
- rvm: 2.2.10
env: REDMINE_VER=master DB=mysql
- rvm: 2.2.8
env: REDMINE_VER=master DB=postgresql

- rvm: 2.3.5
- rvm: 2.3.8
env: REDMINE_VER=master DB=mysql
- rvm: 2.3.5
env: REDMINE_VER=master DB=postgresql

# Redmine < 3.4 does not work with ruby 2.4.
- rvm: 2.4.2
env: REDMINE_VER=3.2.8 DB=mysql
- rvm: 2.4.2
env: REDMINE_VER=3.3.5 DB=mysql
- rvm: 2.4.2
- rvm: 2.4.5
env: REDMINE_VER=master DB=mysql

- rvm: 2.4.2
env: REDMINE_VER=3.2.8 DB=postgresql
- rvm: 2.4.2
env: REDMINE_VER=3.3.5 DB=postgresql
- rvm: 2.4.2
- rvm: 2.5.3
env: REDMINE_VER=master DB=mysql
- rvm: 2.2.10
env: REDMINE_VER=master DB=postgresql
- rvm: 2.3.8
env: REDMINE_VER=master DB=postgresql
- rvm: 2.4.5
env: REDMINE_VER=master DB=postgresql
- rvm: 2.5.3
env: REDMINE_VER=master DB=postgresql

gemfile:
- $REDMINE_PATH/Gemfile

env:
- REDMINE_VER=3.2.8 DB=mysql
- REDMINE_VER=3.3.5 DB=mysql
- REDMINE_VER=3.4.3 DB=mysql
- REDMINE_VER=3.2.8 DB=postgresql
- REDMINE_VER=3.3.5 DB=postgresql
- REDMINE_VER=3.4.3 DB=postgresql
- REDMINE_VER=4.0.0 DB=mysql
- REDMINE_VER=4.0.0 DB=postgresql
- REDMINE_VER=master DB=mysql
- REDMINE_VER=master DB=postgresql

before_install:
- export PLUGIN_NAME=redmine_tags
- export REDMINE_PATH=$HOME/redmine
- export BUNDLE_GEMFILE=$REDMINE_PATH/Gemfile
- git clone https://github.com/redmine/redmine.git --branch $REDMINE_VER --depth 1 $REDMINE_PATH
# TODO: This plugin has to go!
- git clone https://github.com/ZitecCOM/redmine_testing_gems.git --branch 1.3.3 --depth 1 $REDMINE_PATH/plugins/redmine_testing_gems
# TODO: this needs to be a `mv` once the testing plugin is removed.
- ln -s $TRAVIS_BUILD_DIR $REDMINE_PATH/plugins/$PLUGIN_NAME
- cp config/database-$DB-travis.yml $REDMINE_PATH/config/database.yml
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
gem 'acts-as-taggable-on', '~> 4.0'
gem 'acts-as-taggable-on'
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
.PHONY: ci
ci:
@rake redmine:plugins:test RAILS_ENV=test NAME=redmine_tags
@rake redmine:plugins:spec RAILS_ENV=test NAME=redmine_tags

# Prepares the database.
#
Expand All @@ -17,5 +16,4 @@ ci:
# ```
.PHONY: prepare
prepare:
@echo "config.active_record.schema_format = :sql" >> config/additional_environment.rb
@rake db:create db:migrate redmine:plugins:migrate db:structure:dump
@rake db:create db:migrate redmine:plugins:migrate
21 changes: 7 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
Allows marking up different models in Redmine with tags.
Inspired by original `redmine_tags` of Eric Davis.

## Important news
**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.

## Supported models

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

## Requirements

- Ruby `>= 2.1.9`
- Redmine `>= 3.1.7`
- Ruby `>= 2.2.10`
- Redmine `>= 4.0.0`


## Installing
Expand All @@ -42,23 +44,14 @@ Inspired by original `redmine_tags` of Eric Davis.
Make sure you have the latest database structure loaded to the test database:
```
rake db:structure:dump
rake db:drop db:create db:structure:load RAILS_ENV=test
```
You need to have the
[redmine_testing_gems](https://github.com/ZitecCOM/redmine_testing_gems)
plugin:

```
git clone https://github.com/ZitecCOM/redmine_testing_gems.git --branch 1.3.1
bundle install
rake db:drop db:create db:migrate RAILS_ENV=test
```
After you cloned the plugin, run the follwing command:
After you cloned the plugin, run the following command:
```
rake redmine:plugins:spec RAILS_ENV=test NAME=redmine_tags
rake redmine:plugins:test RAILS_ENV=test NAME=redmine_tags
```
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20151209153801_acts_as_taggable_migration.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class ActsAsTaggableMigration < ActiveRecord::Migration
class ActsAsTaggableMigration < ActiveRecord::Migration[4.2]
def up
# ActsAsTaggableOnMigration
unless table_exists?(:tags)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class RemoveWrongTagListJournals < ActiveRecord::Migration
class RemoveWrongTagListJournals < ActiveRecord::Migration[4.2]
def change
# First, remove from journal details the tag changes where the new value is the same with the old_value
JournalDetail.where("prop_key = 'tag_list' AND old_value = value").destroy_all
Expand Down
27 changes: 3 additions & 24 deletions init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

require 'redmine_tags'

# ActiveSupport::Reloader for rails >= 5
# ActionDispatch::Callbacks for rails < 5
reloader = defined?(ActiveSupport::Reloader) ? ActiveSupport::Reloader : ActionDispatch::Callbacks

reloader.to_prepare do
ActiveSupport::Reloader.to_prepare do
paths = '/lib/redmine_tags/{patches/*_patch,hooks/*_hook}.rb'
Dir.glob(File.dirname(__FILE__) + paths).each do |file|
require_dependency file
Expand All @@ -17,11 +13,11 @@
name 'Redmine Tags'
author 'Aleksey V Zapparov AKA "ixti"'
description 'Redmine tagging support'
version '3.2.2'
version '4.0.0'
url 'https://github.com/ixti/redmine_tags/'
author_url 'http://www.ixti.net/'

requires_redmine version_or_higher: '3.0.0'
requires_redmine version_or_higher: '4.0.0'

settings \
default: {
Expand All @@ -33,20 +29,3 @@
},
partial: 'tags/settings'
end

Rails.application.config.after_initialize do
test_dependencies = {
# TODO: do not depend on this for tests.
redmine_testing_gems: '1.3.3'
}
current_plugin = Redmine::Plugin.find(:redmine_tags)
check_dependencies = proc do |plugin, version|
begin
current_plugin.requires_redmine_plugin(plugin, version)
rescue Redmine::PluginNotFound
raise Redmine::PluginNotFound,
"Redmine Tags depends on plugin: #{plugin} version: #{version}"
end
end
test_dependencies.each(&check_dependencies) if Rails.env.test?
end
3 changes: 2 additions & 1 deletion lib/redmine_tags/patches/issue_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ def self.included(base)
acts_as_ordered_taggable

safe_attributes 'tag_list'
alias_method_chain :copy_from, :redmine_tags
alias_method :copy_from_without_redmine_tags, :copy_from
alias_method :copy_from, :copy_from_with_redmine_tags

searchable_options[:columns] << "tags.name"
searchable_options[:preload] << :tags
Expand Down
7 changes: 4 additions & 3 deletions lib/redmine_tags/patches/issue_query_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ module IssueQueryPatch
def self.included(base)
base.send :include, InstanceMethods
base.class_eval do
unloadable
alias_method :available_filters_without_tags, :available_filters
alias_method :available_filters, :available_filters_with_tags

alias_method_chain :available_filters, :tags
alias_method_chain :available_columns, :tags
alias_method :available_columns_without_tags, :available_columns
alias_method :available_columns, :available_columns_with_tags
end
end

Expand Down
17 changes: 0 additions & 17 deletions spec/controllers/add_helpers_for_issue_tags_patch_spec.rb

This file was deleted.

8 changes: 0 additions & 8 deletions spec/controllers/auto_completes_controller_patch_spec.rb

This file was deleted.

108 changes: 0 additions & 108 deletions spec/controllers/tags_controller_spec.rb

This file was deleted.

8 changes: 0 additions & 8 deletions spec/controllers/wiki_controller_patach_spec.rb

This file was deleted.

Loading

0 comments on commit d06e93d

Please sign in to comment.