Class: ActiveRecord::ConnectionAdapters::TableDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/six-updater-web/vendor/plugins/active_scaffold/lib/extensions/schema_definitions.rb

Instance Method Summary collapse

Instance Method Details

#timestamps(*args) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/extensions/schema_definitions.rb', line 4

def timestamps(*args)
  options = args.extract_options!
  lock_version = options.delete(:lock_version).nil?
  deleted_at = options.delete(:deleted_at).nil?
  column(:created_at, :datetime, options)
  column(:deleted_at, :datetime, options) unless deleted_at
  column(:updated_at, :datetime, options)
  column(:lock_version, :integer, {:null => false, :default => 0}) if lock_version
end