redmine_better_files icon indicating copy to clipboard operation
redmine_better_files copied to clipboard

dispacher

Open zdravko opened this issue 11 years ago • 1 comments

What to do with: no such file to load -- dispatcher

It happens so often with many plugins.

zdravko avatar Jun 03 '13 07:06 zdravko

I got this error fixed, but this plugin has more outdated code #2

diff --git a/init.rb b/init.rb
index 06a826b..53e343d 100644
--- a/init.rb
+++ b/init.rb
@@ -1,14 +1,15 @@
 require 'redmine'
-require 'dispatcher'
+#require 'dispatcher'

 Dir[File.join(directory,'vendor','plugins','*')].each do |dir|
   path = File.join(dir, 'lib')
   $LOAD_PATH << path
-  ActiveSupport::Dependencies.load_paths << path
-  ActiveSupport::Dependencies.load_once_paths.delete(path)
+  ActiveSupport::Dependencies.autoload_paths << path
+  ActiveSupport::Dependencies.autoload_once_paths.delete(path)
 end

-Dispatcher.to_prepare :redmine_better_files do 
+#Dispatcher.to_prepare :redmine_better_files do 
+ActionDispatch::Callbacks.to_prepare do 
   require_dependency 'attachments_controller'

   unless Attachment.included_modules.include? RedmineBetterFiles::AttachmentPatch

aapo avatar Nov 29 '13 12:11 aapo