From 15691d396672862df9dc962461e3de43a8472d1c Mon Sep 17 00:00:00 2001 From: Edward Tsech Date: Sun, 14 Feb 2010 19:54:55 +0600 Subject: [PATCH] Adapted plugin to Redmine 0.9 --- README.rdoc | 12 ++++++------ lib/issue_closed.rb | 18 +++++------------- 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/README.rdoc b/README.rdoc index 7a757d8..084b1e1 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,18 +1,18 @@ = Issue_closed + + This redmine plugin closing issues a week after their "Resolving". == Installing delayed_job: To working plugin Redmine Issue Closed you need to install and start delayed_job. Delayed job is plugin for background processes. - - 1) sudo gem install delayed_job - 2) script/plugin install git://github.com/kossnocorp/delayed_job.git + 1) script/plugin install git://github.com/kossnocorp/delayed_job.git - 3) script/generate delayed_job + 2) script/generate delayed_job rake db:migrate - 4) create config/initializers/delayed_job_config.rb and add inside this code: + 3) create config/initializers/delayed_job_config.rb and add inside this code: Delayed::Job.destroy_failed_jobs = false silence_warnings do @@ -20,7 +20,7 @@ Delayed job is plugin for background processes. Delayed::Job.const_set("MAX_RUN_TIME", 7.days) end - 5) rake jobs:work -> for starting background processes + 4) rake jobs:work -> for starting background processes If'll have some problems you would get information by this link: http://github.com/collectiveidea/delayed_job diff --git a/lib/issue_closed.rb b/lib/issue_closed.rb index 8c32e4d..c6e66d7 100644 --- a/lib/issue_closed.rb +++ b/lib/issue_closed.rb @@ -13,14 +13,10 @@ module IssueStatusesController def self.included base base.class_eval do - alias _list list - - def index - list - end + alias_method :_index, :index unless method_defined? :_index - def list - collect_issue_statuses + def index + _index render :template => 'issue_statuses/issue_closed_list' end @@ -36,11 +32,7 @@ def update_issue_closed end status.save! end - redirect_to :action => :list - end - protected - def collect_issue_statuses - @issue_status_pages, @issue_statuses = paginate :issue_statuses, :per_page => 25, :order => "position" + redirect_to :action => :index end end end @@ -63,7 +55,7 @@ def destroy_issue module IssuesController def self.included base base.class_eval do - alias _edit edit + alias_method :_edit, :edit unless method_defined? :_edit def edit status_before_update = @issue.status