Fix restore method for paranoid models

Do not try to update confirmed_hide_at column from models without this column.
This commit is contained in:
Senén Rodero Rodríguez
2019-01-22 14:38:27 +01:00
committed by voodoorai2000
parent db38a87205
commit 458fb750eb

View File

@@ -28,7 +28,7 @@ module ActsAsParanoidAliases
def restore(opts = {})
return false unless hidden?
super(opts)
update_attribute(:confirmed_hide_at, nil)
update_attribute(:confirmed_hide_at, nil) if self.class.column_names.include? "confirmed_hide_at"
after_restore
end