fix database sync when value is nil
This commit is contained in:
parent
d92f3f2298
commit
4bfd7fa6f8
1 changed files with 1 additions and 1 deletions
|
@ -100,7 +100,7 @@ class Article < ActiveRecord::Base
|
|||
# compare attributes from different articles. used for auto-synchronization
|
||||
# returns array of symbolized unequal attributes
|
||||
def self.compare_attributes(attributes)
|
||||
unequal_attributes = attributes.select { |name, values| values[0] != values[1] }
|
||||
unequal_attributes = attributes.select { |name, values| values[0] != values[1] and not (values[0].blank? and values[1].blank?) }
|
||||
unequal_attributes.collect { |pair| pair[0] }
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue