Socket
Book a DemoInstallSign in
Socket

dont_you_count

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dont_you_count

0.0.2
bundlerRubygems
Version published
Maintainers
1
Created
Source

Don't you count

ActiveAdmin is a great way to boostrap a good looking and customizable admin interface in no time. However there are some pererformance issues related to using this tool.

What is it about?

When displaying the index view AA automatically issues a SELECT COUNT(*) SQL query in order to enable pagination. As long as you have no more than couple thousand records in your db it is instant. However once your collections start getting bigger this single query could timeout your server. And this is no good. Setting:

    index pagination_total: false do ...
```
does not prevent the `count` query.

## How to use ?

Gemfile

``` ruby
gem 'dont_you_count' # below activeadmin gem
```

config/initializers/active_admin.rb

````ruby
ActiveAdmin.setup do |config|
  config.dont_count = ['product', 'order']
end

That's it. The count query will no longer be issued for product and offer models. The total count will be guessed instead (based on this gist). It breaks the last pagination button but it is better then breaking the servers.

Compatibility

Tested to work with activeadmin (1.0.0.pre) and kaminari (0.16.1). Let me know if you notice any problems with other versions.

Pull requests are welcome.

FAQs

Package last updated on 12 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.