Performance in User#roles_for_project
|Assignee:||Jean-Philippe Lang||% Done:|
roles are duplicating a scope not an result, thus every hit produce a query, cached, but it is still not desired.
#1 Updated by Go MAEDA over 4 years ago
- Target version set to 3.3.0
I think we can remove the last 'dup' method from Ondřej Ezr's patch because ActiveRecord::Associations::CollectionProxy#to_a returns copied objects.
# File activerecord/lib/active_record/associations/collection_proxy.rb, line 943 def to_ary load_target.dup end