Sha256: cdc87508bfe954bc1fb8374c9f6e30dbce499e9b9503e6634b4d4991b3971b47
Contents?: true
Size: 302 Bytes
Versions: 10
Compression:
Stored size: 302 Bytes
Contents
module Trashable extend ActiveSupport::Concern included do default_scope -> { where(deleted: false) } scope :deleted, -> { where(deleted: true) } def soft_delete update_attribute(:deleted, true) end def recover update_attribute(:deleted, false) end end end
Version data entries
10 entries across 10 versions & 3 rubygems