Act like a paranoid does not restore records

I tried to restore the object from admin mode and did not work

Admin.only_deleted.first.recover Admin Load (1.9ms) SELECT "admins".* FROM "admins" WHERE ("admins"."deleted_at" IS NOT NULL) ORDER BY "admins"."id" ASC LIMIT 1 NoMethodError: undefined method `recover' for #<Admin:0xa57f10c> 

Any idea?

+5
source share
3 answers

Now there is a recovery, not a recovery, but its incorrect recovery of dependent records, which are a real pain

+8
source

I don’t know why the developers did this, but I see that the recovery method has protected visibility.

So you must call this method from the model, and you cannot call it from the outside

0
source

Well, it seems that the problem is in the active version of the record, they moved something and therefore do not restore the records, it is fixed in the newest version.

0
source

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


All Articles