From a48f8089aba974465ccd1f99506f04d1f60ac2d2 Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Wed, 20 Apr 2011 10:43:35 -0400 Subject: Exception got moved to ActiveModel with Rails 3 --- railties/guides/source/active_record_querying.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/railties/guides/source/active_record_querying.textile b/railties/guides/source/active_record_querying.textile index 7cdffe4c2e..2f0a51e868 100644 --- a/railties/guides/source/active_record_querying.textile +++ b/railties/guides/source/active_record_querying.textile @@ -418,7 +418,7 @@ SELECT viewable_by, locked FROM clients Be careful because this also means you're initializing a model object with only the fields that you've selected. If you attempt to access a field that is not in the initialized record you'll receive: -ActiveRecord::MissingAttributeError: missing attribute: +ActiveModel::MissingAttributeError: missing attribute: Where +<attribute>+ is the attribute you asked for. The +id+ method will not raise the +ActiveRecord::MissingAttributeError+, so just be careful when working with associations because they need the +id+ method to function properly. -- cgit v1.2.3