Browse files

use underlying _read_attribute method rather than causing NoMethodErrors

  • Loading branch information...
1 parent 5696d94 commit fcd8925f236b391d562dc504bcd901f501140c11 @tenderlove tenderlove committed Jan 11, 2011
@@ -1578,7 +1578,7 @@ def attribute_for_inspect(attr_name)
# Returns true if the specified +attribute+ has been set by the user or by a database load and is neither
# nil nor empty? (the latter only applies to objects that respond to empty?, most notably Strings).
def attribute_present?(attribute)
- !read_attribute(attribute).blank?
+ !_read_attribute(attribute).blank?
# Returns the column object for the named attribute.
@@ -523,7 +523,7 @@ def test_has_many_through_collection_size_doesnt_load_target_if_not_loaded
def test_has_many_through_collection_size_uses_counter_cache_if_it_exists
author = authors(:david)
- author.stubs(:read_attribute).with('comments_count').returns(100)
+ author.stubs(:_read_attribute).with('comments_count').returns(100)
assert_equal 100, author.comments.size
assert !author.comments.loaded?

0 comments on commit fcd8925

Please sign in to comment.