diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2010-09-02 17:39:56 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2010-09-02 17:39:56 +0000 |
commit | 83b4343d2d403a21de4614016e165091e4c5914f (patch) | |
tree | 52fed892e8c3363c238a1a9e36383e7c34923b5a /app/controllers/project_enumerations_controller.rb | |
parent | b5e90972d88c69a1ef2c9e90879e8926d192acff (diff) | |
download | redmine-83b4343d2d403a21de4614016e165091e4c5914f.tar.gz redmine-83b4343d2d403a21de4614016e165091e4c5914f.zip |
Refactor: move method, ProjectsController#save_activities to ProjectEnumerationsController#save
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4053 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/project_enumerations_controller.rb')
-rw-r--r-- | app/controllers/project_enumerations_controller.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/controllers/project_enumerations_controller.rb b/app/controllers/project_enumerations_controller.rb new file mode 100644 index 000000000..c4b48e476 --- /dev/null +++ b/app/controllers/project_enumerations_controller.rb @@ -0,0 +1,18 @@ +class ProjectEnumerationsController < ApplicationController + before_filter :find_project + before_filter :authorize + + def save + if request.post? && params[:enumerations] + Project.transaction do + params[:enumerations].each do |id, activity| + @project.update_or_create_time_entry_activity(id, activity) + end + end + flash[:notice] = l(:notice_successful_update) + end + + redirect_to :controller => 'projects', :action => 'settings', :tab => 'activities', :id => @project + end + +end |