mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #3628 from oscardelben/refactoring
use any? instead of !empty?
This commit is contained in:
commit
1df22bbb0f
1 changed files with 1 additions and 1 deletions
|
@ -98,7 +98,7 @@ module ActiveModel
|
||||||
# person.name = 'bob'
|
# person.name = 'bob'
|
||||||
# person.changed? # => true
|
# person.changed? # => true
|
||||||
def changed?
|
def changed?
|
||||||
!changed_attributes.empty?
|
changed_attributes.any?
|
||||||
end
|
end
|
||||||
|
|
||||||
# List of attributes with unsaved changes.
|
# List of attributes with unsaved changes.
|
||||||
|
|
Loading…
Reference in a new issue