Sha256: 86c84f94deae25527600c69b0875a986d0a907d3b4efad23483fceca8b06fdd7

Contents?: true

Size: 524 Bytes

Versions: 2

Compression:

Stored size: 524 Bytes

Contents

module ActiveArchive
  module TableDefinition

    def timestamps(*args)
      options = args.extract_options!
      options[:null] = false if options[:null].nil?

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

      return unless ActiveArchive::Settings.config.all_records_archivable == true
      options[:null] = true
      column(:archived_at, :datetime, options)
    end

  end
end

ActiveRecord::ConnectionAdapters::TableDefinition.prepend(ActiveArchive::TableDefinition)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
active_archive-4.0.4 lib/active_archive/table_definition.rb
active_archive-4.0.3 lib/active_archive/table_definition.rb