Actions
Patch #26721
closeduse find_by instead of detect
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
Updated by jwjw yy over 7 years ago
- File project.rb.2.diff project.rb.2.diff added
same situation for copy_issues
Updated by jwjw yy over 7 years ago
- File project.rb.3.diff project.rb.3.diff added
Updated by Toshi MARUYAMA over 7 years ago
- Tracker changed from Defect to Patch
- Description updated (diff)
- Category set to Code cleanup/refactoring
- Target version set to 4.1.0
Please don't use "Defect" tracker for not defect.
Please use code highlighting in description. It is too hard to read.
Updated by Pavel Rosický over 7 years ago
enabled_modules and versions are usually preloaded, so detect is more effective then find_by that will always trigger a new database query
Updated by Toshi MARUYAMA over 7 years ago
- Status changed from New to Needs feedback
- Target version deleted (
4.1.0)
Updated by Go MAEDA over 3 years ago
- Status changed from Needs feedback to Closed
Pavel Rosický wrote:
enabled_modules and versions are usually preloaded, so detect is more effective then find_by that will always trigger a new database query
Closing.
Actions