LoginSignup
1
2

More than 5 years have passed since last update.

ActiveAdmin.registerでassociationのfilterをすべて無効にする

Posted at

ActiveAdmin.registerで毎回remove_filterやるのめんどくさい。。
そしてそれをうっかり忘れてたらページがとんでもなく重くなることがある。。:fearful:
(全association引っ張ってきてるので当然)

対応

include_default_association_filtersというオプションがあるのでそいつをfalseにします。

config/active_admin.rb
ActiveAdmin.setup do |config|
  config.default_namespace = :hoge_admin

  # namespace単位で設定します。
  config.namespace(:hoge_admin).include_default_association_filters = false
  ...

以上です。
ActiveAdminはこういうの多いので大変 :hugging:

参考

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2