Sha256: 588ab8aedf8154e1f2768ff6f99283af9cdbcbdb624f3f3bd6c97b7635e3f0a2
Contents?: true
Size: 393 Bytes
Versions: 9
Compression:
Stored size: 393 Bytes
Contents
# frozen_string_literal: true module ActiveArchive module Methods def archivable? columns.detect { |col| col.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(&:unarchive) end end end
Version data entries
9 entries across 9 versions & 1 rubygems