提交 1df22bbb 编写于 作者: Y Yehuda Katz

Merge pull request #3628 from oscardelben/refactoring

use any? instead of !empty?
...@@ -98,7 +98,7 @@ module Dirty ...@@ -98,7 +98,7 @@ module Dirty
# 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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册