ruby-on-railsrails-administrate

Administrate and unscoping default scope


I have a model with a default scope:

default_scope -> { where(is_active: true) }

Can I unscope the model in Administrate, so the I can see all the records in the admin panel?


Solution

  • You could do:

    User.unscope(where: :is_active)
    

    but it would probably be better to just not have a default scope if you are not going to use it everywhere.

    link