-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Perf issue with "all" scope #77
Milestone
Comments
Here's a workaround: |
ghost
assigned gregbell
May 24, 2011
I was having the same issue. |
Pushed to the wrong repos. :-/ |
pcreux
added a commit
to pcreux/active_admin
that referenced
this issue
Aug 6, 2011
Scope :all does not call :all on the relation anymore but returns the ActiveRecord class instead. Moved the logic scoping the scope into a helper called ScopeChain. I wanted to implement this method on the Scope class itself but that runs the scoping block in the Scope instance context instead of the ResourceController one. This method is both used in the ResourceController and the ViewHelper Scopes. @gregbell: Could we share this method without creating a new helper?
whatthewhat
pushed a commit
to whatthewhat/active_admin
that referenced
this issue
Aug 13, 2011
Scope :all does not call :all on the relation anymore but returns the ActiveRecord class instead. Moved the logic scoping the scope into a helper called ScopeChain. I wanted to implement this method on the Scope class itself but that runs the scoping block in the Scope instance context instead of the ResourceController one. This method is both used in the ResourceController and the ViewHelper Scopes. @gregbell: Could we share this method without creating a new helper?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was doing some perf testing and found this issue.
activeadmin-demo/admin/products.rb in your activeadmin-demo project:
line 3: scope :all, :default => true
Adding the "all" scope causes a full table read on the following line:
active_admin/views/components/scopes.rb:
line 52: scoping_class.send(scope.scope_method).count
The perf here gets really bad after a few thousand records.
The text was updated successfully, but these errors were encountered: