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