Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

small fixes to merging logic

  • Loading branch information...
commit 88a6dd0b5f4f1ef4d2ce6c37623c3cd3ea488ee1 1 parent a9a1308
@Bringo Bringo authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 app/models/asset.rb
View
5 app/models/asset.rb
@@ -316,7 +316,7 @@ def merge_existing
break
end
end
-
+
if existing_asset
existing_asset.merge(self)
existing_asset.save
@@ -331,7 +331,6 @@ def merge_existing
def merge(new_asset)
[:identifiers, :titles, :asset_dates, :descriptions, :relations, :coverages, :creators, :contributors,
:publishers, :rights_summaries, :instantiations, :annotations, :extensions].each do |field|
-
current_fields = self.send(field)
new_fields = new_asset.send(field)
@@ -350,6 +349,8 @@ def merge(new_asset)
end
# Just import the new instantiation
current_fields << fields
+ else
+ current_fields << fields
end
else
current_fields << fields unless current_attrs.include?(clean_attributes(fields.attributes))
Please sign in to comment.
Something went wrong with that request. Please try again.