1
有一個關於它已被刪除後恢復模型部分。
If you want to restore a record and their dependently destroyed associated records:
Client.restore(id, :recursive => true)
然而,當我嘗試這在我的控制器:
@user = User.only_deleted.find(params[:id])
@user.restore! :recursive => true
我得到這個錯誤:
wrong number of arguments (1 for 0)
這是我在我的Gemfile:
gem 'paranoia', '~> 1.0'
我看到這已被合併到主所以我不知道我在做什麼錯在這裏:
https://github.com/radar/paranoia/pull/91
更新:
當我改變(如答案建議)
@user.restore! :recursive => true
到
User.restore(params[:id], :recursive => true)
Get the foll由於錯誤:
wrong number of arguments (2 for 1)
更新II: 有沒有人使用的此功能(遞歸)與軌道3?
因爲它說,我要改變它在下面這個拉請求https://github.com/radar/paranoia/pull/91或者你無法不找了一遍 – London
刪除答案,如果你決定用叉子去,如果你不知道如何,我可以幫你。 http://chat.stackoverflow.com/rooms/45145/room-for-london-and-rmagnum2002 – rmagnum2002