Module: ActiveArchive::TableDefinition

Defined in:
lib/active_archive/table_definition.rb

Instance Method Summary collapse

Instance Method Details

#timestamps(*args) ⇒ Object


6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/active_archive/table_definition.rb', line 6

def timestamps(*args)
  options = args.extract_options!

  column(:created_at, :datetime, options)
  column(:updated_at, :datetime, options)

  return unless ActiveArchive.configuration.all_records_archivable == true
  return if options[:archive] == false

  options[:null] = true
  column(:archived_at, :datetime, options)
end