lib/ddr/models/attached_files_profile.rb in ddr-models-3.0.0.beta.4 vs lib/ddr/models/attached_files_profile.rb in ddr-models-3.0.0.beta.6

- old
+ new

@@ -8,10 +8,14 @@ def initialize(files_hash) @files_hash = files_hash end def attributes - files_hash.keys.each_with_object({}) { |k, memo| memo[k.to_s] = nil } + files_hash.keys.each_with_object({}) do |key, memo| + unless files_hash[key].destroyed? + memo[key.to_s] = nil + end + end end def read_attribute_for_serialization(key) AttachedFileProfile.new(files_hash[key]) end