Configure Paranoia for ActiveRecord models
coreTo enable soft-deletion, first add a deleted_at datetime column with an index to your table via a migration. Then, call acts_as_paranoid in your model.
Migration Example:
class AddDeletedAtToClients < ActiveRecord::Migration
def change
add_column :clients, :deleted_at, :datetime
add_index :clients, :deleted_at
end
endModel Example:
class Client < ActiveRecord::Base
acts_as_paranoid
end