From 32f06ea7d9b14ca846814a1c9ace96884541d8ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 5 Sep 2020 14:47:58 +0200 Subject: [PATCH] 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. --- config/application.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/application.rb b/config/application.rb index cd56a56a2..cf73f4c96 100644 --- a/config/application.rb +++ b/config/application.rb @@ -10,7 +10,8 @@ module Consul class Application < Rails::Application 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 # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.