1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Added :nodoc: for attribute_changed? and attribute_was [ci skip]

These methods were made "public" in 47617ecd so that `method_missing`
can invoke them without going through `send`, but they aren't meant
for consumption from outside of Rails.
This commit is contained in:
Godfrey Chan 2013-12-12 12:01:52 -08:00
parent 93ee9f0cba
commit f650981483

View file

@ -149,12 +149,12 @@ module ActiveModel
end end
# Handle <tt>*_changed?</tt> for +method_missing+. # Handle <tt>*_changed?</tt> for +method_missing+.
def attribute_changed?(attr) def attribute_changed?(attr) # :nodoc:
changed_attributes.include?(attr) changed_attributes.include?(attr)
end end
# Handle <tt>*_was</tt> for +method_missing+. # Handle <tt>*_was</tt> for +method_missing+.
def attribute_was(attr) def attribute_was(attr) # :nodoc:
attribute_changed?(attr) ? changed_attributes[attr] : __send__(attr) attribute_changed?(attr) ? changed_attributes[attr] : __send__(attr)
end end