aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods/read.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2014-06-16 11:20:55 -0600
committerSean Griffin <sean@thoughtbot.com>2014-06-16 11:20:55 -0600
commit218105f58e30bc9487ad59fa455878c35262a0a5 (patch)
tree154d5d04242632c81c39800ee1fc729522345b14 /activerecord/lib/active_record/attribute_methods/read.rb
parentd8569bd49887f045ec949aa85a1e78f5438e9b88 (diff)
downloadrails-218105f58e30bc9487ad59fa455878c35262a0a5.tar.gz
rails-218105f58e30bc9487ad59fa455878c35262a0a5.tar.bz2
rails-218105f58e30bc9487ad59fa455878c35262a0a5.zip
Refactor in-place dirty checking to use the attribute object
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods/read.rb')
-rw-r--r--activerecord/lib/active_record/attribute_methods/read.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/read.rb b/activerecord/lib/active_record/attribute_methods/read.rb
index 8c1cc128f7..525c46970a 100644
--- a/activerecord/lib/active_record/attribute_methods/read.rb
+++ b/activerecord/lib/active_record/attribute_methods/read.rb
@@ -99,6 +99,10 @@ module ActiveRecord
def attribute(attribute_name)
read_attribute(attribute_name)
end
+
+ def attribute_named(attribute_name)
+ @attributes.fetch(attribute_name, Attribute::Null)
+ end
end
end
end