Search code examples
ruby-on-railsrubyrails-adminruby-paranoia

Rails_admin and paranoia


Is there a way to manage the 'soft-deleted' records that paranoia produces when I delete something? What I mean is that any records I delete in rails_admin or rails console aren't actually deleted, instead paranoia marks them with a deleted_at timestamp, which takes them out of view scope.

I'd like to be able to see these deleted records for auditing, potential recovery, or to really delete them for good.

I have a basic install of rails_admin and paranoia, nothing special.

Also, this previously asked question was no help.


Solution

  • list do
      scopes [nil, :only_deleted]
    end
    

    nil, simply means no scope, or original scope I should say. See more details on rails_admin's Wiki

    Remember paranoia, simply adds a default scope, so records are hidden by default, but unscoped or one of the provided scopes should show them.