Project

General

Profile

Actions

Patch #26721

closed

use find_by instead of detect

Added by jwjw yy over 7 years ago. Updated over 3 years ago.

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

0%

Estimated time:

Description

In project.rb

enable_module(name)
 enabled_modules.detect {|m| m.name == name}
end 

should be replaced by in order to only get the specified enabled_module instead of doing filtering after retrieving them all.

enabled_modules.find_by(name: name)

Files

project.rb.diff (472 Bytes) project.rb.diff jwjw yy, 2017-08-19 05:01
project.rb.2.diff (1.07 KB) project.rb.2.diff jwjw yy, 2017-08-19 05:27
project.rb.3.diff (2.32 KB) project.rb.3.diff jwjw yy, 2017-08-19 05:43
Actions

Also available in: Atom PDF