Enable active_record.belongs_to_required_by_default

This switches the logic so that belongs_to parent objects must exist
by default, and marks the optional ones explicitly. This is reflected
in the null/not_null status on the relevant db columns.
This commit is contained in:
Andy Allan 2022-02-23 15:17:21 +00:00 committed by Tom Hughes
parent 3cf3b3ce4e
commit 619ac4c5b2
11 changed files with 15 additions and 19 deletions

View file

@ -35,10 +35,6 @@ module OpenStreetMap
# This has defaulted to false since rails 6.0
config.action_view.default_enforce_utf8 = true
# This defaults to true from rails 5.0 but our code doesn't comply
# with it at all so we turn it off
config.active_record.belongs_to_required_by_default = false unless Settings.status == "database_offline"
# Use SQL instead of Active Record's schema dumper when creating the database.
# This is necessary if your schema can't be completely dumped by the schema dumper,
# like if you have constraints or database-specific column types