fix database sync when value is nil

This commit is contained in:
wvengen 2014-02-03 13:29:38 +01:00
parent d92f3f2298
commit 4bfd7fa6f8

View file

@ -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