Closed stylesuxx closed 11 years ago
the "dispatcher" problem is a none issue.
However, there is an even worse problem with the module a bit deeper once you correct/recode the dispatcher block. Specifically the "route'" functions are not working as hoped. Am looking into fixing it myself atm. If I get it working before an update is made I will post here.
So. I got it to install with the code below. However, afterwards it breaks the Activity view. So there is still work to be done. I am also not 100% certain that the routes are correct as I cannot test because of it breaking the install. Below are the init.rb and routes.rb
redmine_pastebin/init.rb:
#
#
#
#
require 'redmine'
require_dependency 'redmine_pastebin/view_hooks'
ActionDispatch::Callbacks.to_prepare do require_dependency 'project' require_dependency 'user'
unless Project.included_modules.include? RedminePastebin::ProjectPastesPatch Project.send(:include, RedminePastebin::ProjectPastesPatch) end
unless User.included_modules.include? RedminePastebin::UserPastesPatch User.send(:include, RedminePastebin::UserPastesPatch) end end
Redmine::Plugin.register :redmine_pastebin do name 'Redmine Pastebin plugin' author 'Alex Shulgin ash@commandprompt.com' description 'A real pastebin plugin for redmine' version '0.0.1' url 'https://github.com/commandprompt/redmine_pastebin/'
requires_redmine :version_or_higher => '1.1.0'
project_module :pastes do permission :view_pastes, :pastes => [:index, :show, :download] permission :add_pastes, :pastes => [:new, :create] permission :edit_pastes, :pastes => [:edit, :update] permission :delete_pastes, :pastes => [:destroy] end
menu :project_menu, :pastes, { :controller => 'pastes', :action => 'index' }, :caption => :label_paste_plural, :after => :label_wiki, :param => :project_id end
Redmine::Activity.map do |activity| activity.register :pastes end
Redmine::Search.map do |search| search.register :pastes end
redmine_pastebin/config/routes.rb: RedmineApp::Application.routes.draw do
resources :pastes, :except => :new do get :download, :on => :member end scope "/:project_id" do resources :pastes do get :download, :on => :member end end end
Redmine-2.x support was added (not so) recently.
Hey, when using redmine version 2.1.2 and trying to install your Plugin, I get the following error:
rake aborted!
no such file to load -- dispatcher