Sha256: d712dca0a06453c96165b1ec852fcdc3034a6a9cf04ee56a697d5fb684e239cb

Contents?: true

Size: 532 Bytes

Versions: 13

Compression:

Stored size: 532 Bytes

Contents

# frozen_string_literal: true

module ActiveArchive
  module TableDefinition

    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[:skip]

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

  end
end

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

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
active_archive-5.3.0 lib/active_archive/table_definition.rb
active_archive-5.2.2 lib/active_archive/table_definition.rb
active_archive-5.2.1 lib/active_archive/table_definition.rb
active_archive-5.2.0 lib/active_archive/table_definition.rb
active_archive-5.1.7 lib/active_archive/table_definition.rb
active_archive-5.1.6 lib/active_archive/table_definition.rb
active_archive-5.1.5 lib/active_archive/table_definition.rb
active_archive-5.1.4 lib/active_archive/table_definition.rb
active_archive-5.1.3 lib/active_archive/table_definition.rb
active_archive-5.1.2 lib/active_archive/table_definition.rb
active_archive-5.1.1 lib/active_archive/table_definition.rb
active_archive-5.1.0 lib/active_archive/table_definition.rb
active_archive-5.0.0 lib/active_archive/table_definition.rb