Redmine 4.1.1
This commit is contained in:
parent
33e7b881a5
commit
3d976f1b3b
1593 changed files with 36180 additions and 19489 deletions
|
@ -1,5 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Redmine - project management software
|
||||
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||
# Copyright (C) 2006-2019 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
|
@ -30,15 +32,15 @@ class IssueStatus < ActiveRecord::Base
|
|||
validates_uniqueness_of :name
|
||||
validates_length_of :name, :maximum => 30
|
||||
validates_inclusion_of :default_done_ratio, :in => 0..100, :allow_nil => true
|
||||
attr_protected :id
|
||||
|
||||
scope :sorted, lambda { order(:position) }
|
||||
scope :named, lambda {|arg| where("LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip)}
|
||||
|
||||
safe_attributes 'name',
|
||||
safe_attributes(
|
||||
'name',
|
||||
'is_closed',
|
||||
'position',
|
||||
'default_done_ratio'
|
||||
'default_done_ratio')
|
||||
|
||||
# Update all the +Issues+ setting their done_ratio to the value of their +IssueStatus+
|
||||
def self.update_issue_done_ratios
|
||||
|
@ -89,7 +91,7 @@ class IssueStatus < ActiveRecord::Base
|
|||
|
||||
# Updates issues closed_on attribute when an existing status is set as closed.
|
||||
def handle_is_closed_change
|
||||
if is_closed_changed? && is_closed == true
|
||||
if saved_change_to_is_closed? && is_closed == true
|
||||
# First we update issues that have a journal for when the current status was set,
|
||||
# a subselect is used to update all issues with a single query
|
||||
subquery = Journal.joins(:details).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue