プロジェクト

全般

プロフィール

Vote #77043

完了

Performance in User#roles_for_project

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Performance_53
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
53
version_id:
110
issue_org_id:
21582
author_id:
111145
assigned_to_id:
1
comments:
4
status_id:
5
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

roles are duplicating a scope not an result, thus every hit produce a query, cached, but it is still not desired.


journals

I think we can remove the last 'dup' method from Ondřej Ezr's patch because ActiveRecord::Associations::CollectionProxy#to_a returns copied objects.

<pre><code class="ruby">
# File activerecord/lib/active_record/associations/collection_proxy.rb, line 943
def to_ary
load_target.dup
end
</code></pre>

--------------------------------------------------------------------------------
true, I just put to_a there with heureka feeling, but you are right dup is meaningless now :)
--------------------------------------------------------------------------------
Thanks for your feedback. Nice eureka!
--------------------------------------------------------------------------------
Committed, thanks.
--------------------------------------------------------------------------------

Admin Redmine さんが約4年前に更新

  • カテゴリPerformance_53 にセット
  • 対象バージョン3.3.0_110 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0