Module: ActiveArchive::Methods

Defined in:
lib/active_archive/methods.rb

Instance Method Summary collapse

Instance Method Details

#archivable?Boolean

Returns:

  • (Boolean)

6
7
8
# File 'lib/active_archive/methods.rb', line 6

def archivable?
  columns.detect { |col| col.name == 'archived_at' }
end

#archive_all(conditions = nil) ⇒ Object


10
11
12
# File 'lib/active_archive/methods.rb', line 10

def archive_all(conditions = nil)
  records(conditions, action: :archive)
end

#unarchive_all(conditions = nil) ⇒ Object


14
15
16
# File 'lib/active_archive/methods.rb', line 14

def unarchive_all(conditions = nil)
  records(conditions, action: :unarchive)
end