LoginSignup
2
1

More than 5 years have passed since last update.

Rails gem tips: 論理削除が有効なモデルで物理削除を行う(paranoia gem)

Posted at

前提

ActiveRecordの論理削除を行うparanoia gemを使用していること

class XXXModel < ApplicationRecord
  acts_as_paranoid # 論理削除有効

本題

物理削除を行いたい場合は really_destory! をコールする


XXXModel.find(0).really_destroy!
2
1
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
2
1