Defect #21504

IssuePriority.position_name not recalculated every time it should

Added by Felix Schäfer over 2 years ago. Updated over 2 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Administration
Target version:3.1.4
Resolution:Fixed Affected version:

Description

The position_name attribute of IssuePriority instances is currently only recalculated when the position of the IssuePriority instance changes source:/tags/3.2.0/app/models/issue_priority.rb#L22

However, the position_name should also be recalculated when the active attribute changes.

I would even argue that that operation is quick enough, and that changes to the IssuePriority list are not frequent and done by administrators, so that the recalculation of the position_name can be done on after_save without filtering.

Patch to follow.

Associated revisions

Revision 14988
Added by Jean-Philippe Lang over 2 years ago

IssuePriority.position_name not recalculated every time it should (#21504).

Patch by Felix Schäfer.

Revision 14989
Added by Jean-Philippe Lang over 2 years ago

IssuePriority.position_name not recalculated every time it should (#21504).

Patch by Felix Schäfer.

History

#2 Updated by Jean-Philippe Lang over 2 years ago

  • Category set to Administration
  • Status changed from New to Resolved
  • Assignee set to Jean-Philippe Lang
  • Target version set to 3.1.4
  • Resolution set to Fixed

Felix Schäfer wrote:

I would even argue that that operation is quick enough, and that changes to the IssuePriority list are not frequent and done by administrators, so that the recalculation of the position_name can be done on after_save without filtering.

Sure, it's quick enough and this issue would not occur but code that runs when it's actually needed is also a good thing.
Patch committed, thanks.

#3 Updated by Jean-Philippe Lang over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF