Refactored core Redmine patches so the plugin can be run in development.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
class RatesController < ApplicationController
|
||||
unloadable
|
||||
helper :users
|
||||
helper :sort
|
||||
include SortHelper
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class Rate < ActiveRecord::Base
|
||||
unloadable
|
||||
class InvalidParameterException < Exception; end
|
||||
|
||||
belongs_to :project
|
||||
|
||||
11
init.rb
11
init.rb
@@ -1,9 +1,18 @@
|
||||
require 'redmine'
|
||||
|
||||
require 'rate_users_helper_patch'
|
||||
# Patches to the Redmine core
|
||||
require 'dispatcher'
|
||||
require 'rate_sort_helper_patch'
|
||||
require 'rate_time_entry_patch'
|
||||
require 'rate_users_helper_patch'
|
||||
|
||||
Dispatcher.to_prepare do
|
||||
SortHelper.send(:include, RateSortHelperPatch)
|
||||
TimeEntry.send(:include, RateTimeEntryPatch)
|
||||
UsersHelper.send(:include, RateUsersHelperPatch)
|
||||
end
|
||||
|
||||
# Hooks
|
||||
require 'rate_project_hook'
|
||||
|
||||
Redmine::Plugin.register :redmine_rate do
|
||||
|
||||
@@ -103,5 +103,5 @@ module RateSortHelperPatch
|
||||
end
|
||||
end
|
||||
|
||||
SortHelper.send(:include, RateSortHelperPatch)
|
||||
|
||||
|
||||
|
||||
@@ -35,4 +35,4 @@ module RateTimeEntryPatch
|
||||
end
|
||||
end
|
||||
|
||||
TimeEntry.send(:include, RateTimeEntryPatch)
|
||||
|
||||
|
||||
@@ -34,5 +34,3 @@ module RateUsersHelperPatch
|
||||
end
|
||||
end
|
||||
|
||||
UsersHelper.send(:include, RateUsersHelperPatch)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user