mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Merge pull request #3628 from oscardelben/refactoring
use any? instead of !empty?
This commit is contained in:
@@ -98,7 +98,7 @@ module ActiveModel
|
||||
# person.name = 'bob'
|
||||
# person.changed? # => true
|
||||
def changed?
|
||||
!changed_attributes.empty?
|
||||
changed_attributes.any?
|
||||
end
|
||||
|
||||
# List of attributes with unsaved changes.
|
||||
|
||||
Reference in New Issue
Block a user