From 31e9b8075db792876f7409d862300cdada5a8b2f Mon Sep 17 00:00:00 2001 From: Marcelo Date: Wed, 10 Aug 2022 13:38:23 +0200 Subject: [PATCH] Explains why model[] is preferred over read_attribute --- README.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.adoc b/README.adoc index 9c6432c..cbeef99 100644 --- a/README.adoc +++ b/README.adoc @@ -518,7 +518,7 @@ end === Read Attribute [[read-attribute]] -Prefer `self[:attribute]` over `read_attribute(:attribute)`. +Prefer `self[:attribute]` over `read_attribute(:attribute)`. The former raises an `ActiveModel::MissingAttributeError` if the attribute is missing, whereas the latter does not. [source,ruby] ----