Sha256: 6151f733703a3270f884a8d60b3b96a05af1b48d2de8c9b7b04aa0e9f8163e05
Contents?: true
Size: 460 Bytes
Versions: 4
Compression:
Stored size: 460 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) records(conditions, action: :archive) end def unarchive_all(conditions = nil) records(conditions, action: :unarchive) end private def records(conditions = nil, action:) where(conditions).find_each(&action) end end end
Version data entries
4 entries across 4 versions & 1 rubygems