aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2012-03-28 23:47:12 -0700
committerJosé Valim <jose.valim@gmail.com>2012-03-28 23:47:12 -0700
commite83e76eca4e134c91c4c2c1092b41f4483592172 (patch)
treed2d6abbdf828026391a293df6eb0bc33ac7f3794 /activemodel/lib
parentc4d90e42042e66faee9ff2a32625cb250c15b4ed (diff)
parent5e705221004fe78f901cd7461fe59da5dc926706 (diff)
downloadrails-e83e76eca4e134c91c4c2c1092b41f4483592172.tar.gz
rails-e83e76eca4e134c91c4c2c1092b41f4483592172.tar.bz2
rails-e83e76eca4e134c91c4c2c1092b41f4483592172.zip
Merge pull request #4904 from ask4prasath/refactor_dirty_module_with_helper
Changing active model dirty module helper method to more appropriate met...
Diffstat (limited to 'activemodel/lib')
-rw-r--r--activemodel/lib/active_model/dirty.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/dirty.rb b/activemodel/lib/active_model/dirty.rb
index 026f077ee7..d327913824 100644
--- a/activemodel/lib/active_model/dirty.rb
+++ b/activemodel/lib/active_model/dirty.rb
@@ -1,6 +1,7 @@
require 'active_model/attribute_methods'
require 'active_support/hash_with_indifferent_access'
require 'active_support/core_ext/object/duplicable'
+require 'active_support/core_ext/object/blank'
module ActiveModel
# == Active Model Dirty
@@ -98,7 +99,7 @@ module ActiveModel
# person.name = 'bob'
# person.changed? # => true
def changed?
- changed_attributes.any?
+ changed_attributes.present?
end
# List of attributes with unsaved changes.