mirror of https://github.com/rails/rails
Merge pull request #4904 from ask4prasath/refactor_dirty_module_with_helper
Changing active model dirty module helper method to more appropriate met...
This commit is contained in:
commit
e83e76eca4
|
@ -1,6 +1,7 @@
|
||||||
require 'active_model/attribute_methods'
|
require 'active_model/attribute_methods'
|
||||||
require 'active_support/hash_with_indifferent_access'
|
require 'active_support/hash_with_indifferent_access'
|
||||||
require 'active_support/core_ext/object/duplicable'
|
require 'active_support/core_ext/object/duplicable'
|
||||||
|
require 'active_support/core_ext/object/blank'
|
||||||
|
|
||||||
module ActiveModel
|
module ActiveModel
|
||||||
# == Active Model Dirty
|
# == Active Model Dirty
|
||||||
|
@ -98,7 +99,7 @@ module ActiveModel
|
||||||
# person.name = 'bob'
|
# person.name = 'bob'
|
||||||
# person.changed? # => true
|
# person.changed? # => true
|
||||||
def changed?
|
def changed?
|
||||||
changed_attributes.any?
|
changed_attributes.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
# List of attributes with unsaved changes.
|
# List of attributes with unsaved changes.
|
||||||
|
|
Loading…
Reference in New Issue