@@ -35,7 +35,8 class IssueStatusesController < ApplicationController | |||
|
35 | 35 | end |
|
36 | 36 | |
|
37 | 37 | def create |
|
38 |
@issue_status = IssueStatus.new |
|
|
38 | @issue_status = IssueStatus.new | |
|
39 | @issue_status.safe_attributes = params[:issue_status] | |
|
39 | 40 | if @issue_status.save |
|
40 | 41 | flash[:notice] = l(:notice_successful_create) |
|
41 | 42 | redirect_to issue_statuses_path |
@@ -50,7 +51,8 class IssueStatusesController < ApplicationController | |||
|
50 | 51 | |
|
51 | 52 | def update |
|
52 | 53 | @issue_status = IssueStatus.find(params[:id]) |
|
53 |
|
|
|
54 | @issue_status.safe_attributes = params[:issue_status] | |
|
55 | if @issue_status.save | |
|
54 | 56 | respond_to do |format| |
|
55 | 57 | format.html { |
|
56 | 58 | flash[:notice] = l(:notice_successful_update) |
@@ -16,6 +16,8 | |||
|
16 | 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
17 | 17 | |
|
18 | 18 | class IssueStatus < ActiveRecord::Base |
|
19 | include Redmine::SafeAttributes | |
|
20 | ||
|
19 | 21 | before_destroy :check_integrity |
|
20 | 22 | has_many :workflows, :class_name => 'WorkflowTransition', :foreign_key => "old_status_id" |
|
21 | 23 | has_many :workflow_transitions_as_new_status, :class_name => 'WorkflowTransition', :foreign_key => "new_status_id" |
@@ -33,6 +35,11 class IssueStatus < ActiveRecord::Base | |||
|
33 | 35 | scope :sorted, lambda { order(:position) } |
|
34 | 36 | scope :named, lambda {|arg| where("LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip)} |
|
35 | 37 | |
|
38 | safe_attributes 'name', | |
|
39 | 'is_closed', | |
|
40 | 'position', | |
|
41 | 'default_done_ratio' | |
|
42 | ||
|
36 | 43 | # Update all the +Issues+ setting their done_ratio to the value of their +IssueStatus+ |
|
37 | 44 | def self.update_issue_done_ratios |
|
38 | 45 | if Issue.use_status_for_done_ratio? |
General Comments 0
You need to be logged in to leave comments.
Login now