Sha256: 1ac382c3f9a515d1ea372c2c7e716b8d0fe80b9fdd907ab06328a28c83d6aa31
Contents?: true
Size: 360 Bytes
Versions: 7
Compression:
Stored size: 360 Bytes
Contents
module ActiveArchive module Methods def archivable? columns.detect { |c| c.name == "archived_at" } end def archive_all(conditions=nil) conditions ? where(conditions).destroy_all : destroy_all end def unarchive_all(conditions=nil) (conditions ? where(conditions) : all).to_a.each { |r| r.unarchive } end end end
Version data entries
7 entries across 7 versions & 1 rubygems