8000 Avoid computing scope_chain when an AsyncCount is present · activeadmin/activeadmin@415ffb0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 415ffb0

Browse files
jdlubranomgrunberg
authored andcommitted
Avoid computing scope_chain when an AsyncCount is present
Co-authored-by: Matias Grunberg <matias@yellowspot.dev>
1 parent 61a3c1f commit 415ffb0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/active_admin/views/components/scopes.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ def current_scope?(scope)
5858

5959
# Return the count for the scope passed in.
6060
def get_scope_count(scope)
61-
chained = scope_chain(scope, collection_before_scope)
61+
chained = @async_counts[scope] || scope_chain(scope, collection_before_scope)
6262

63-
collection_size(@async_counts[scope] || chained)
63+
collection_size(chained)
6464
end
6565

6666
def group_name(group)

0 commit comments

Comments
 (0)
0