From 5201240214f802a8f1f9dfb551bc6c886bbff977 Mon Sep 17 00:00:00 2001 From: Sebastian Schuster Date: Wed, 22 Jan 2014 14:30:57 +0100 Subject: [PATCH] Updated patches to take advantage of the plugins plugin patching --- .../costs/patches/application_controller_patch.rb | 4 ---- lib/open_project/costs/patches/application_helper_patch.rb | 6 +----- lib/open_project/costs/patches/permitted_params_patch.rb | 4 ---- lib/open_project/costs/patches/project_patch.rb | 4 ---- .../costs/patches/projects_controller_patch.rb | 4 ---- lib/open_project/costs/patches/query_patch.rb | 4 ---- lib/open_project/costs/patches/role_patch.rb | 2 -- lib/open_project/costs/patches/time_entry_patch.rb | 4 ---- lib/open_project/costs/patches/user_patch.rb | 7 ------- lib/open_project/costs/patches/users_helper_patch.rb | 4 ---- lib/open_project/costs/patches/version_patch.rb | 4 ---- lib/open_project/costs/patches/work_package_patch.rb | 3 --- 12 files changed, 1 insertion(+), 49 deletions(-) diff --git a/lib/open_project/costs/patches/application_controller_patch.rb b/lib/open_project/costs/patches/application_controller_patch.rb index 2798ed6e1c..fe858d66f8 100644 --- a/lib/open_project/costs/patches/application_controller_patch.rb +++ b/lib/open_project/costs/patches/application_controller_patch.rb @@ -1,5 +1,3 @@ -require_dependency 'application_controller' - module OpenProject::Costs::Patches::ApplicationControllerPatch def self.included(base) # :nodoc: base.send(:include, InstanceMethods) @@ -17,5 +15,3 @@ module OpenProject::Costs::Patches::ApplicationControllerPatch end end end - -ApplicationController.send(:include, OpenProject::Costs::Patches::ApplicationControllerPatch) diff --git a/lib/open_project/costs/patches/application_helper_patch.rb b/lib/open_project/costs/patches/application_helper_patch.rb index 6615c6f1cc..dc4e91f779 100644 --- a/lib/open_project/costs/patches/application_helper_patch.rb +++ b/lib/open_project/costs/patches/application_helper_patch.rb @@ -1,6 +1,4 @@ -require_dependency 'application_helper' - -module OpenProject::Costs::PatchesApplicationHelperPatch +module OpenProject::Costs::Patches::ApplicationHelperPatch def self.included(base) # :nodoc: # Same as typing in the class base.class_eval do @@ -23,5 +21,3 @@ module OpenProject::Costs::PatchesApplicationHelperPatch end end end - -ApplicationHelper.send(:include, OpenProject::Costs::PatchesApplicationHelperPatch) diff --git a/lib/open_project/costs/patches/permitted_params_patch.rb b/lib/open_project/costs/patches/permitted_params_patch.rb index 7cfb44d92f..719d62dd80 100644 --- a/lib/open_project/costs/patches/permitted_params_patch.rb +++ b/lib/open_project/costs/patches/permitted_params_patch.rb @@ -1,5 +1,3 @@ -require_dependency 'permitted_params' - module OpenProject::Costs::Patches::PermittedParamsPatch def self.included(base) # :nodoc: @@ -39,5 +37,3 @@ module OpenProject::Costs::Patches::PermittedParamsPatch end end end - -PermittedParams.send(:include, OpenProject::Costs::Patches::PermittedParamsPatch) diff --git a/lib/open_project/costs/patches/project_patch.rb b/lib/open_project/costs/patches/project_patch.rb index c17bbb9aed..7923d0c19f 100644 --- a/lib/open_project/costs/patches/project_patch.rb +++ b/lib/open_project/costs/patches/project_patch.rb @@ -1,5 +1,3 @@ -require_dependency 'project' - module OpenProject::Costs::Patches::ProjectPatch def self.included(base) # :nodoc: # Same as typing in the class @@ -17,5 +15,3 @@ module OpenProject::Costs::Patches::ProjectPatch end end - -Project.send(:include, OpenProject::Costs::Patches::ProjectPatch) diff --git a/lib/open_project/costs/patches/projects_controller_patch.rb b/lib/open_project/costs/patches/projects_controller_patch.rb index 857f526056..f27ce4b196 100644 --- a/lib/open_project/costs/patches/projects_controller_patch.rb +++ b/lib/open_project/costs/patches/projects_controller_patch.rb @@ -1,5 +1,3 @@ -require_dependency 'projects_controller' - module OpenProject::Costs::Patches::ProjectsControllerPatch def self.included(base) # :nodoc: base.send(:include, InstanceMethods) @@ -19,5 +17,3 @@ module OpenProject::Costs::Patches::ProjectsControllerPatch end end end - -ProjectsController.send(:include, OpenProject::Costs::Patches::ProjectsControllerPatch) diff --git a/lib/open_project/costs/patches/query_patch.rb b/lib/open_project/costs/patches/query_patch.rb index 50afb15c42..f9645c5bad 100644 --- a/lib/open_project/costs/patches/query_patch.rb +++ b/lib/open_project/costs/patches/query_patch.rb @@ -1,5 +1,3 @@ -require_dependency 'query' - module OpenProject::Costs::Patches::QueryPatch class CurrencyQueryColumn < QueryColumn unloadable @@ -67,5 +65,3 @@ module OpenProject::Costs::Patches::QueryPatch end end end - -Query.send(:include, OpenProject::Costs::Patches::QueryPatch) diff --git a/lib/open_project/costs/patches/role_patch.rb b/lib/open_project/costs/patches/role_patch.rb index b16875c710..6628c1f850 100644 --- a/lib/open_project/costs/patches/role_patch.rb +++ b/lib/open_project/costs/patches/role_patch.rb @@ -67,5 +67,3 @@ module OpenProject::Costs::Patches::RolePatch end end end - -Role.send(:include, OpenProject::Costs::Patches::RolePatch) diff --git a/lib/open_project/costs/patches/time_entry_patch.rb b/lib/open_project/costs/patches/time_entry_patch.rb index 02afb1490f..c9965e7ba5 100644 --- a/lib/open_project/costs/patches/time_entry_patch.rb +++ b/lib/open_project/costs/patches/time_entry_patch.rb @@ -1,5 +1,3 @@ -require_dependency 'time_entry' - # Patches Redmine's Users dynamically. module OpenProject::Costs::Patches::TimeEntryPatch def self.included(base) # :nodoc: @@ -106,5 +104,3 @@ module OpenProject::Costs::Patches::TimeEntryPatch end end end - -TimeEntry.send(:include, OpenProject::Costs::Patches::TimeEntryPatch) diff --git a/lib/open_project/costs/patches/user_patch.rb b/lib/open_project/costs/patches/user_patch.rb index 64af7b0aa0..ca6c2d68a8 100644 --- a/lib/open_project/costs/patches/user_patch.rb +++ b/lib/open_project/costs/patches/user_patch.rb @@ -1,8 +1,3 @@ -require_dependency 'project' - -require_dependency 'principal' -require_dependency 'user' - module OpenProject::Costs::Patches::UserPatch def self.included(base) # :nodoc: base.send(:include, InstanceMethods) @@ -95,5 +90,3 @@ module OpenProject::Costs::Patches::UserPatch end end end - -User.send(:include, OpenProject::Costs::Patches::UserPatch) diff --git a/lib/open_project/costs/patches/users_helper_patch.rb b/lib/open_project/costs/patches/users_helper_patch.rb index 894ec18416..5f6252a5bd 100644 --- a/lib/open_project/costs/patches/users_helper_patch.rb +++ b/lib/open_project/costs/patches/users_helper_patch.rb @@ -1,5 +1,3 @@ -require_dependency 'users_helper' - module OpenProject::Costs::Patches::UsersHelperPatch def self.included(base) # :nodoc: base.send(:include, InstanceMethods) @@ -20,5 +18,3 @@ module OpenProject::Costs::Patches::UsersHelperPatch end end end - -UsersHelper.send(:include, OpenProject::Costs::Patches::UsersHelperPatch) diff --git a/lib/open_project/costs/patches/version_patch.rb b/lib/open_project/costs/patches/version_patch.rb index 81218e63cf..22a92d935c 100644 --- a/lib/open_project/costs/patches/version_patch.rb +++ b/lib/open_project/costs/patches/version_patch.rb @@ -1,5 +1,3 @@ -require_dependency 'version' - module OpenProject::Costs::Patches::VersionPatch def self.included(base) # :nodoc: base.send(:include, InstanceMethods) @@ -16,5 +14,3 @@ module OpenProject::Costs::Patches::VersionPatch end end end - -Version.send(:include, OpenProject::Costs::Patches::VersionPatch) diff --git a/lib/open_project/costs/patches/work_package_patch.rb b/lib/open_project/costs/patches/work_package_patch.rb index 3125bb23ca..60051d99df 100644 --- a/lib/open_project/costs/patches/work_package_patch.rb +++ b/lib/open_project/costs/patches/work_package_patch.rb @@ -1,5 +1,3 @@ -require 'work_package' - module OpenProject::Costs::Patches::WorkPackagePatch def self.included(base) # :nodoc: base.extend(ClassMethods) @@ -126,4 +124,3 @@ module OpenProject::Costs::Patches::WorkPackagePatch end WorkPackage::SAFE_ATTRIBUTES << "cost_object_id" if WorkPackage.const_defined? "SAFE_ATTRIBUTES" -WorkPackage.send(:include, OpenProject::Costs::Patches::WorkPackagePatch)