Module: Mycroseconds::Migration::TableDefinition

Defined in:
lib/mycroseconds/migration.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



31
32
33
34
35
# File 'lib/mycroseconds/migration.rb', line 31

def self.included(base)
  base.class_eval do
    alias_method_chain :timestamps, :precision
  end
end

Instance Method Details

#timestamps_with_precision(*args) ⇒ Object



37
38
39
40
41
42
43
# File 'lib/mycroseconds/migration.rb', line 37

def timestamps_with_precision(*args)
  timestamps_without_precision(*args)

  if ADAPTER_NAMES.include?(@base.adapter_name.downcase)
    column(:updated_at_precision, :integer, :default => 0, :null => false)
  end
end