Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixes performance issue introduced in 3.0.6 (issue #6695)

  • Loading branch information...
commit 93641ed6c8c684f6b4db02b6c8a22fa9bc7f0eaf 1 parent fb6fa1e
@stiang stiang authored tenderlove committed
Showing with 5 additions and 3 deletions.
  1. +5 −3 activerecord/lib/active_record/attribute_methods/read.rb
View
8 activerecord/lib/active_record/attribute_methods/read.rb
@@ -84,9 +84,11 @@ def define_read_method(symbol, attr_name, column)
# Returns the value of the attribute identified by <tt>attr_name</tt> after it has been typecast (for example,
# "2004-12-12" in a data column is cast to a date object, like Date.new(2004, 12, 12)).
def read_attribute(attr_name)
- send "_#{attr_name}"
- rescue NoMethodError
- _read_attribute attr_name
+ if respond_to? "_#{attr_name}"
+ send "_#{attr_name}"
+ else
+ _read_attribute attr_name
+ end
end
def _read_attribute(attr_name)
Please sign in to comment.
Something went wrong with that request. Please try again.