Keep belongs_to optional by default

Changing it would mean reviewing and changing all our existing models,
and some of them might be tricky (like our Document and Image models,
which only validate certain associations in some cases), so we're
keeping it the way it's been until now.
This commit is contained in:
Javi Martín
2020-09-05 14:47:58 +02:00
parent b1c112952f
commit 32f06ea7d9

View File

@@ -10,7 +10,8 @@ module Consul
class Application < Rails::Application class Application < Rails::Application
config.load_defaults 5.0 config.load_defaults 5.0
# Overwrite Rails 5.0 defaults and use the options we used in Rails 4 # Keep belongs_to fields optional by default, because that's the way
# Rails 4 models worked
config.active_record.belongs_to_required_by_default = false config.active_record.belongs_to_required_by_default = false
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.