Sha256: df766e8b218a8a2d6fc5c02b16a17a8008d0077ce667ca2b86efe90a08d921c9

Contents?: true

Size: 362 Bytes

Versions: 5

Compression:

Stored size: 362 Bytes

Contents

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

5 entries across 5 versions & 1 rubygems

Version Path
active_archive-4.0.7 lib/active_archive/methods.rb
active_archive-4.0.6 lib/active_archive/methods.rb
active_archive-4.0.5 lib/active_archive/methods.rb
active_archive-4.0.4 lib/active_archive/methods.rb
active_archive-4.0.3 lib/active_archive/methods.rb