diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-01-04 00:24:40 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-01-04 11:58:43 -0300 |
commit | a939506f297b667291480f26fa32a373a18ae06a (patch) | |
tree | 67f9dbd9df438ae2bf36b772790939425c446a2b /activerecord/test/cases/migration | |
parent | 94c87156fd67047d96a6805f2f7b8db0a59cd37a (diff) | |
download | rails-a939506f297b667291480f26fa32a373a18ae06a.tar.gz rails-a939506f297b667291480f26fa32a373a18ae06a.tar.bz2 rails-a939506f297b667291480f26fa32a373a18ae06a.zip |
Change the default `null` value for `timestamps` to `false`
Diffstat (limited to 'activerecord/test/cases/migration')
-rw-r--r-- | activerecord/test/cases/migration/change_schema_test.rb | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/activerecord/test/cases/migration/change_schema_test.rb b/activerecord/test/cases/migration/change_schema_test.rb index 337360e97f..b3129a8984 100644 --- a/activerecord/test/cases/migration/change_schema_test.rb +++ b/activerecord/test/cases/migration/change_schema_test.rb @@ -195,32 +195,29 @@ module ActiveRecord end def test_create_table_with_timestamps_should_create_datetime_columns - # 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 + connection.create_table table_name do |t| + t.timestamps end created_columns = connection.columns(table_name) created_at_column = created_columns.detect {|c| c.name == 'created_at' } updated_at_column = created_columns.detect {|c| c.name == 'updated_at' } - assert created_at_column.null - assert updated_at_column.null + assert !created_at_column.null + assert !updated_at_column.null end def test_create_table_with_timestamps_should_create_datetime_columns_with_options connection.create_table table_name do |t| - t.timestamps :null => false + t.timestamps null: true end created_columns = connection.columns(table_name) created_at_column = created_columns.detect {|c| c.name == 'created_at' } updated_at_column = created_columns.detect {|c| c.name == 'updated_at' } - assert !created_at_column.null - assert !updated_at_column.null + assert created_at_column.null + assert updated_at_column.null end def test_create_table_without_a_block |