Refactored core Redmine patches so the plugin can be run in development.

This commit is contained in:
Eric Davis
2009-04-21 21:44:58 -07:00
parent 5513f0064b
commit 452edfeeaa
6 changed files with 14 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
class RatesController < ApplicationController
unloadable
helper :users
helper :sort
include SortHelper

View File

@@ -1,4 +1,5 @@
class Rate < ActiveRecord::Base
unloadable
class InvalidParameterException < Exception; end
belongs_to :project

11
init.rb
View File

@@ -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

View File

@@ -103,5 +103,5 @@ module RateSortHelperPatch
end
end
SortHelper.send(:include, RateSortHelperPatch)

View File

@@ -35,4 +35,4 @@ module RateTimeEntryPatch
end
end
TimeEntry.send(:include, RateTimeEntryPatch)

View File

@@ -34,5 +34,3 @@ module RateUsersHelperPatch
end
end
UsersHelper.send(:include, RateUsersHelperPatch)