From 6576f7354e50afb79881aaf3a6f50f4e81dfab70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=A0im=C3=A1nek?= Date: Sat, 14 Feb 2015 03:24:54 +0100 Subject: Require `belongs_to` by default. Deprecate `required` option in favor of `optional` for belongs_to. --- activerecord/CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'activerecord/CHANGELOG.md') diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 52aaa2371d..b636ffdc97 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,3 +1,10 @@ +* `belongs_to` will now trigger a validation error by default if the association is not present. + You can turn this off on a per-association basis with `optional: true`. + (Note this new default only applies to new Rails apps that will be generated with + `config.active_record.belongs_to_required_by_default = true` in initializer.) + + *Josef Šimánek* + * Fixed ActiveRecord::Relation#becomes! and changed_attributes issues for type column Fixes #17139. -- cgit v1.2.3