Commit 9c566b38 by delba

use a GuardClause

parent 5aaef5ad
......@@ -20,7 +20,8 @@ module Paranoia
end
def delete
update_attribute_or_column(:deleted_at, Time.now) if !deleted? && persisted?
return if new_record? || destroyed?
update_attribute_or_column :deleted_at, Time.now
end
def restore!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment