From b3490d82ba87219fbfc00c112184d9b6b06bc908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Tapaj=C3=B3s?= Date: Tue, 27 Dec 2011 20:31:29 -0200 Subject: Closes #4208 --- activerecord/lib/active_record/relation/query_methods.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index c281bead0d..26246510e6 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -63,10 +63,11 @@ module ActiveRecord # => [#] # # Any attributes that do not have fields retrieved by a select - # will return `nil` when the getter method for that attribute is used: + # will raise a ActiveModel::MissingAttributeError when the getter method for that attribute is used: # # >> Model.select(:field).first.other_field - # => nil + # => ActiveModel::MissingAttributeError: missing attribute: other_field + def select(value = Proc.new) if block_given? to_a.select {|*block_args| value.call(*block_args) } -- cgit v1.2.3