Skip to content

Commit

Permalink
Merge pull request #89 from yzzy/redmine4_compatibility
Browse files Browse the repository at this point in the history
Redmine4 compatibility
  • Loading branch information
jperelli authored Jan 15, 2019
2 parents 00c8537 + 24388b5 commit f4098c5
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/Gemfile.lock
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
language: ruby

rvm:
- 2.1.0
- 2.3.4

env:
- REDMINE_VERSION=3.1.1 VERBOSE=yes
- REDMINE_VERSION=3.4.7 VERBOSE=yes

install:
- export PLUGIN=periodictask
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
gem 'business_time'
gem 'protected_attributes_continued'
6 changes: 3 additions & 3 deletions app/controllers/periodictask_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ class PeriodictaskController < ApplicationController
unloadable


before_filter :find_project
before_action :find_project
#before_filter :find_periodictask, :except => [:new, :create, :index]
before_filter :load_users, :except => [:destroy]
before_filter :load_categories, :except => [:destroy]
before_action :load_users, :except => [:destroy]
before_action :load_categories, :except => [:destroy]

def index
if !params[:project_id] then return end
Expand Down
4 changes: 3 additions & 1 deletion db/migrate/20110922180841_create_periodictasks.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
class CreatePeriodictasks < ActiveRecord::Migration
active_record_migration_class = ActiveRecord::Migration.respond_to?(:current_version) ? ActiveRecord::Migration[4.2] : ActiveRecord::Migration

class CreatePeriodictasks < active_record_migration_class
def self.up
create_table :periodictasks do |t|
t.column :project_id, :integer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
class AddDateAndDescriptionToPeriodictasks < ActiveRecord::Migration
active_record_migration_class = ActiveRecord::Migration.respond_to?(:current_version) ? ActiveRecord::Migration[4.2] : ActiveRecord::Migration

class AddDateAndDescriptionToPeriodictasks < active_record_migration_class
def self.up
add_column :periodictasks, :set_start_date, :boolean, :null => false, :default => false
add_column :periodictasks, :due_date_number, :integer, :null => true, :default => nil
Expand Down
4 changes: 3 additions & 1 deletion db/migrate/20151002140303_add_category_to_periodictasks.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
class AddCategoryToPeriodictasks < ActiveRecord::Migration
active_record_migration_class = ActiveRecord::Migration.respond_to?(:current_version) ? ActiveRecord::Migration[4.2] : ActiveRecord::Migration

class AddCategoryToPeriodictasks < active_record_migration_class
def self.up
add_column :periodictasks, :issue_category_id, :integer, :null => true, :default => nil
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
class AddEstimatedHoursToPeriodictasks < ActiveRecord::Migration
active_record_migration_class = ActiveRecord::Migration.respond_to?(:current_version) ? ActiveRecord::Migration[4.2] : ActiveRecord::Migration

class AddEstimatedHoursToPeriodictasks < active_record_migration_class
def self.up
add_column :periodictasks, :estimated_hours, :float, :null => true, :default => nil
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
class AddChecklistsTemplateIdToPeriodictasks < ActiveRecord::Migration
active_record_migration_class = ActiveRecord::Migration.respond_to?(:current_version) ? ActiveRecord::Migration[4.2] : ActiveRecord::Migration

class AddChecklistsTemplateIdToPeriodictasks < active_record_migration_class
def self.up
add_column :periodictasks, :checklists_template_id, :integer, :null => true, :default => nil
end
Expand Down
2 changes: 2 additions & 0 deletions lib/tasks/periodictask.rake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Check for and assign periodic tasks
Example:
rake redmine:check_periodictasks RAILS_ENV="production"
END_DESC

Rails.configuration.active_job.queue_adapter = :inline
require File.expand_path(File.dirname(__FILE__) + "/../../../../config/environment")

namespace :redmine do
Expand Down

0 comments on commit f4098c5

Please sign in to comment.