Patch #23519

Don't preload projects and roles on Principal#memberships association

Added by Ondřej Ezr over 1 year ago. Updated 11 months ago.

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

0%

Category:Performance
Target version:3.4.0

Description

Why it should preload project and roles by default? it is not used over the redmine much, and somewhare it is not good to preloading those associations.

memberships_performance.diff Magnifier (3.42 KB) Ondřej Ezr, 2016-08-05 17:50

memberships_performance.diff Magnifier - v2 - no reason to use preload for one entity (3.13 KB) Ondřej Ezr, 2016-08-12 17:15

Associated revisions

Revision 16153
Added by Jean-Philippe Lang 11 months ago

Don't preload projects and roles on Principal#memberships association (#23519).

Patch by Ondřej Ezr.

Revision 16154
Added by Jean-Philippe Lang 11 months ago

Reset #roles on reload (#23519).

Revision 16155
Added by Jean-Philippe Lang 11 months ago

Don't destructively insert builtin_role into roles (#23519).

Revision 16156
Added by Jean-Philippe Lang 11 months ago

Preload :roles for displaying user memberships (#23519).

History

#1 Updated by Ondřej Ezr over 1 year ago

No reason for preload in membership(...)

#2 Updated by Toshi MARUYAMA about 1 year ago

  • Target version set to 3.4.0

#3 Updated by Jean-Philippe Lang 11 months ago

  • Subject changed from Performance for memberships to Don't preload projects and roles on Principal#memberships association
  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang

Patch committed, thanks. FTR, the proposed patch was not working as expected and broke a few tests, #roles has to be called explicitly (using self.roles) due to a variable naming clash in #allowed_to?.

Also available in: Atom PDF