aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2010-11-20 07:38:08 +0800
committerAaron Patterson <aaron.patterson@gmail.com>2010-11-24 01:36:59 +0800
commit14055ea28285107af04ed0ce4ef0ec542a9a9530 (patch)
treefdad8ffc2c68a637ace79b8f13a71c4eebef8c97 /activerecord
parentda583df50c32d50261b682664fe43fd5e2f58f87 (diff)
downloadrails-14055ea28285107af04ed0ce4ef0ec542a9a9530.tar.gz
rails-14055ea28285107af04ed0ce4ef0ec542a9a9530.tar.bz2
rails-14055ea28285107af04ed0ce4ef0ec542a9a9530.zip
No need to define a local var here.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/base.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index aa028c6f36..f9743b4fea 100644
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -1569,8 +1569,7 @@ MSG
# 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)
- value = read_attribute(attribute)
- !value.blank?
+ !read_attribute(attribute).blank?
end
# Returns the column object for the named attribute.