Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Refactor: extract method in bulk_update.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4040 e93f8b46-1217-0410-a6f0-8f06a7374b81
  • Loading branch information...
commit daa4272c0e7f657a0070424224cabccbbeca6197 1 parent bc951a9
@edavis10 edavis10 authored
Showing with 8 additions and 4 deletions.
  1. +8 −4 app/controllers/issues_controller.rb
View
12 app/controllers/issues_controller.rb
@@ -198,11 +198,8 @@ def bulk_edit
def bulk_update
@issues.sort!
+ attributes = parse_params_for_bulk_issue_attributes(params)
- attributes = (params[:issue] || {}).reject {|k,v| v.blank?}
- attributes.keys.each {|k| attributes[k] = '' if attributes[k] == 'none'}
- attributes[:custom_field_values].reject! {|k,v| v.blank?} if attributes[:custom_field_values]
-
unsaved_issue_ids = []
@issues.each do |issue|
issue.reload
@@ -318,4 +315,11 @@ def check_for_default_issue_status
return false
end
end
+
+ def parse_params_for_bulk_issue_attributes(params)
+ attributes = (params[:issue] || {}).reject {|k,v| v.blank?}
+ attributes.keys.each {|k| attributes[k] = '' if attributes[k] == 'none'}
+ attributes[:custom_field_values].reject! {|k,v| v.blank?} if attributes[:custom_field_values]
+ attributes
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.