If you are running Rails 4.2, you will notice the generated migration add a default option to timestamps:
1 2 3 4 5 6 7 8 |
|
Without the null: false
it will emit a warning:
1 2 3 |
|
This null option is:
:null - allows or disallows NULL values in the column. This option could have been named :null_allowed.
null: false
means you cannot give NULL values for created_at and updated_at on Rails 5.
So far so good, That’s it!!! See ya!!! :)