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/test/cases/migration/change_schema_test.rb | |
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/test/cases/migration/change_schema_test.rb')
-rw-r--r-- | activerecord/test/cases/migration/change_schema_test.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/activerecord/test/cases/migration/change_schema_test.rb b/activerecord/test/cases/migration/change_schema_test.rb index c66eaf1ee1..bd3dd29f4d 100644 --- a/activerecord/test/cases/migration/change_schema_test.rb +++ b/activerecord/test/cases/migration/change_schema_test.rb @@ -176,8 +176,11 @@ module ActiveRecord end def test_create_table_with_timestamps_should_create_datetime_columns - connection.create_table table_name do |t| - t.timestamps + # FIXME: Remove the silence when we change the default `null` behavior + ActiveSupport::Deprecation.silence do + connection.create_table table_name do |t| + t.timestamps + end end created_columns = connection.columns(table_name) |