diff --git a/README.md b/README.md index 2c8a055..0b50d72 100644 --- a/README.md +++ b/README.md @@ -33,4 +33,4 @@ You can setup options in administration menu. ## Compatibility -This version supports redmine 3.x. +This version supports redmine 4.x. diff --git a/app/controllers/reminder_configuration_controller.rb b/app/controllers/reminder_configuration_controller.rb index ab289b0..8bf8845 100644 --- a/app/controllers/reminder_configuration_controller.rb +++ b/app/controllers/reminder_configuration_controller.rb @@ -3,7 +3,7 @@ class ReminderConfigurationController < ApplicationController layout 'admin' - before_filter :require_admin + before_action :require_admin def edit @configuration = ReminderConfiguration.instance diff --git a/init.rb b/init.rb index e243884..7f12d33 100644 --- a/init.rb +++ b/init.rb @@ -14,4 +14,4 @@ html: { class: 'reminder_options_label' } end -require_dependency 'redmine_reminder/hooks' +require File.expand_path('lib/hooks', __dir__) diff --git a/lib/ar_condition.rb b/lib/ar_condition.rb index efd6989..07d6b46 100644 --- a/lib/ar_condition.rb +++ b/lib/ar_condition.rb @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -class ARCondition +class ArCondition attr_reader :conditions def initialize(condition=nil) diff --git a/lib/redmine_reminder/collector.rb b/lib/collector.rb similarity index 96% rename from lib/redmine_reminder/collector.rb rename to lib/collector.rb index 90ed49c..0fe8a2f 100644 --- a/lib/redmine_reminder/collector.rb +++ b/lib/collector.rb @@ -1,4 +1,4 @@ -class RedmineReminder::Collector +class Collector attr_reader :options def initialize(options) @@ -48,7 +48,7 @@ def collect_reminders # Get issues due in X days def issues_due_in_days due_date = options.days.day.from_now.to_date - sql_condition = ARCondition.new ["#{Issue.table_name}.due_date <= ?", due_date] + sql_condition = ArCondition.new ["#{Issue.table_name}.due_date <= ?", due_date] sql_condition << issue_statuses sql_condition << projects sql_condition << trackers diff --git a/lib/hooks.rb b/lib/hooks.rb new file mode 100644 index 0000000..48d9e50 --- /dev/null +++ b/lib/hooks.rb @@ -0,0 +1,5 @@ +class Hooks < Redmine::Hook::ViewListener + render_on :view_layouts_base_html_head, + partial: 'hooks/redmine_reminder/includes' +end + diff --git a/lib/redmine_reminder/hooks.rb b/lib/redmine_reminder/hooks.rb deleted file mode 100644 index 53c6588..0000000 --- a/lib/redmine_reminder/hooks.rb +++ /dev/null @@ -1,7 +0,0 @@ -module RedmineReminder - class Hooks < Redmine::Hook::ViewListener - render_on :view_layouts_base_html_head, - partial: 'hooks/redmine_reminder/includes' - end -end - diff --git a/lib/redmine_reminder/reminder.rb b/lib/reminder.rb similarity index 89% rename from lib/redmine_reminder/reminder.rb rename to lib/reminder.rb index 5c2a30a..955b7fa 100644 --- a/lib/redmine_reminder/reminder.rb +++ b/lib/reminder.rb @@ -1,4 +1,4 @@ -class RedmineReminder::Reminder +class Reminder attr_reader :user, :issues def initialize(user)