Gemstone paranoia recovery has one dependent destruction not working

I use

Paranoia gem(3.1.1)
Rails 3.2

I noticed that it is has_one :model, dependent: :destroynot recovering.

Say ..

class User < ActiveRecord::Base
  acts_as_paranoid
  has_many :posts, dependent: :destroy
  has_one :profile, dependent: :destroy

If I do it.

@user.destroy
User.restore(@user.id, recursive: true)

the user and his messages will be restored, but not the profile.

Is there anything I can do to make it work?

By the way, I am using a forked version of Paranoia because I cannot get this version https://github.com/radar/paranoia/blob/rails3/lib/paranoia.rb#L105

+4
source share

Source: https://habr.com/ru/post/1536180/


All Articles