Permalink
Browse files

Merge pull request #4904 from ask4prasath/refactor_dirty_module_with_…

…helper

Changing active model dirty module helper method to more appropriate met...
  • Loading branch information...
2 parents c4d90e4 + 5e70522 commit e83e76eca4e134c91c4c2c1092b41f4483592172 @josevalim josevalim committed Mar 29, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 activemodel/lib/active_model/dirty.rb
View
3 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 Dirty
# person.name = 'bob'
# person.changed? # => true
def changed?
- changed_attributes.any?
+ changed_attributes.present?
end
# List of attributes with unsaved changes.

0 comments on commit e83e76e

Please sign in to comment.