Project

General

Profile

Actions

Patch #36730

closed

Replace Member.find_or_new with ActiveRecord's find_or_initialize_by

Added by Go MAEDA over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Code cleanup/refactoring
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

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


Files

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

Related issues

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

Actions
Actions #1

Updated by Go MAEDA over 2 years ago

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

Updated by Go MAEDA over 2 years ago

In r21447, I already replaced some Member.find_or_new.

Actions #3

Updated by Go MAEDA over 2 years ago

  • Target version set to 5.0.0

Setting the target version to 5.0.0.

Actions #4

Updated by Go MAEDA over 2 years ago

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

Committed the patch.

Actions

Also available in: Atom PDF