Skip to content

redmine 4.0 compatibility #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ You can setup options in administration menu.

## Compatibility

This version supports redmine 3.x.
This version supports redmine 4.x.
2 changes: 1 addition & 1 deletion app/controllers/reminder_configuration_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class ReminderConfigurationController < ApplicationController

layout 'admin'

before_filter :require_admin
before_action :require_admin

def edit
@configuration = ReminderConfiguration.instance
Expand Down
2 changes: 1 addition & 1 deletion init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
html: { class: 'reminder_options_label' }
end

require_dependency 'redmine_reminder/hooks'
require File.expand_path('lib/hooks', __dir__)
2 changes: 1 addition & 1 deletion lib/ar_condition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions lib/redmine_reminder/collector.rb → lib/collector.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class RedmineReminder::Collector
class Collector
attr_reader :options

def initialize(options)
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions lib/hooks.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class Hooks < Redmine::Hook::ViewListener
render_on :view_layouts_base_html_head,
partial: 'hooks/redmine_reminder/includes'
end

7 changes: 0 additions & 7 deletions lib/redmine_reminder/hooks.rb

This file was deleted.

2 changes: 1 addition & 1 deletion lib/redmine_reminder/reminder.rb → lib/reminder.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class RedmineReminder::Reminder
class Reminder
attr_reader :user, :issues

def initialize(user)
Expand Down