Patch #36730

Replace Member.find_or_new with ActiveRecord's find_or_initialize_by

Added by Go MAEDA 4 months ago. Updated 4 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Code cleanup/refactoring
Target version:5.0.0

Description

Member.find_or_new can be replaced with ActiveRecord's find_or_initialize_by introduced in Rails 4.

https://api.rubyonrails.org/classes/ActiveRecord/Relation.html#method-i-find_or_initialize_by

find_or_initialize_by.patch Magnifier (2.52 KB) Go MAEDA, 2022-03-06 03:38


Related issues

Related to Redmine - Feature #36696: Improve performance of adding or removing members of a group Closed

Associated revisions

Revision 21456
Added by Go MAEDA 4 months ago

Replace Member.find_or_new with ActiveRecord's find_or_initialize_by (#36730).

History

#1 Updated by Go MAEDA 4 months ago

  • Related to Feature #36696: Improve performance of adding or removing members of a group added

#2 Updated by Go MAEDA 4 months ago

In r21447, I already replaced some Member.find_or_new.

#3 Updated by Go MAEDA 4 months ago

  • Target version set to 5.0.0

Setting the target version to 5.0.0.

#4 Updated by Go MAEDA 4 months ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA

Committed the patch.

Also available in: Atom PDF