Module: ActiveRecord::ConnectionAdapters::TimestampDefaultDeprecation

Included in:
SchemaStatements, TableDefinition
Defined in:
activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#emit_warning_if_null_unspecified(sym, options) ⇒ Object


60
61
62
63
64
65
66
67
68
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 60

def emit_warning_if_null_unspecified(sym, options)
  return if options.key?(:null)

  ActiveSupport::Deprecation.warn(<<-MSG.squish)
    `##{sym}` was called without specifying an option for `null`. In Rails 5,
    this behavior will change to `null: false`. You should manually specify
   `null: true` to prevent the behavior of your existing migrations from changing.
  MSG
end