From 0400a7ff574f83f2f5d5c3f7d7569bfb37963dda Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sat, 20 Apr 2013 09:26:07 +0200 Subject: if singletons belong to the contract, test them Object#respond_to? returns singletons and thus we inherit that contract. The implementation of the predicate is good, but the test is only checking boolean semantics, which in this case is not enough. --- activerecord/lib/active_record/attribute_methods.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb index d0c51b77c2..7f59d0b4c6 100644 --- a/activerecord/lib/active_record/attribute_methods.rb +++ b/activerecord/lib/active_record/attribute_methods.rb @@ -167,7 +167,7 @@ module ActiveRecord self.class.define_attribute_methods unless self.class.attribute_methods_generated? result = super - # If the result is false then it means this method is not supported by ActiveModel too + # If the result is false the answer is false. return false unless result # If the result is true then check for the select case. -- cgit v1.2.3