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:
parent
93ee9f0cba
commit
f650981483
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue