diff --git a/app/models/metadata_template.rb b/app/models/metadata_template.rb index 823443d2..89fd8315 100644 --- a/app/models/metadata_template.rb +++ b/app/models/metadata_template.rb @@ -38,18 +38,10 @@ MetadataTemplate = Struct.new(:site, :document, :name, :label, :type, "#{cache_key}-#{cache_version}" end - # XXX: Deberíamos sanitizar durante la asignación? - def value=(new_value) - @value_was = value - self[:value] = new_value - end - # Siempre obtener el valor actual y solo obtenerlo del documento una # vez. def value_was - return @value_was if instance_variable_defined? '@value_was' - - @value_was = document_value + @value_was ||= document_value.nil? ? default_value : document_value end def changed?