instance method
add_timestamps
Ruby on Rails 4.0.13
Since v2.2.3Signature
add_timestamps(table_name, options = {})
Adds timestamps (created_at and updated_at) columns to the named table.
add_timestamps(:suppliers)
Parameters
-
table_namereq -
optionsopt = {}
Source
# File activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb, line 730
def add_timestamps(table_name, options = {})
add_column table_name, :created_at, :datetime, options
add_column table_name, :updated_at, :datetime, options
end
Defined in activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb line 730
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::SchemaStatements