diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-08-12 14:23:14 -0600 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-08-12 14:40:11 -0600 |
commit | ea3ba34506c72d636096245016b5ef9cfe27c566 (patch) | |
tree | dd7f1c1ca5d3afafa56f914556dfe7acc7d6c414 /activerecord/lib/rails | |
parent | 82e28492e7c581cdeea904464a18eb11118f4ac0 (diff) | |
download | rails-ea3ba34506c72d636096245016b5ef9cfe27c566.tar.gz rails-ea3ba34506c72d636096245016b5ef9cfe27c566.tar.bz2 rails-ea3ba34506c72d636096245016b5ef9cfe27c566.zip |
Change the default `null` value for timestamps
As per discussion, this changes the model generators to specify
`null: false` for timestamp columns. A warning is now emitted if
`timestamps` is called without a `null` option specified, so we can
safely change the behavior when no option is specified in Rails 5.
Diffstat (limited to 'activerecord/lib/rails')
-rw-r--r-- | activerecord/lib/rails/generators/active_record/migration/templates/create_table_migration.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/rails/generators/active_record/migration/templates/create_table_migration.rb b/activerecord/lib/rails/generators/active_record/migration/templates/create_table_migration.rb index fd94a2d038..f7bf6987c4 100644 --- a/activerecord/lib/rails/generators/active_record/migration/templates/create_table_migration.rb +++ b/activerecord/lib/rails/generators/active_record/migration/templates/create_table_migration.rb @@ -9,7 +9,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration <% end -%> <% end -%> <% if options[:timestamps] %> - t.timestamps + t.timestamps null: false <% end -%> end <% attributes_with_index.each do |attribute| -%> |