Skip to content

Commit

Permalink
Hotfix to set record_type after auth_merge rism-digital#746
Browse files Browse the repository at this point in the history
  • Loading branch information
HirschSt committed Mar 5, 2019
1 parent 39282d9 commit ad2cb73
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/authority_merge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def migrate_to_id(new_id)
refs << self.send(s)
end
refs.flatten.each do |s|
record_type = s.has_attribute?(:record_type) ? s.record_type : nil
klass = s.marc.class
s.marc.change_authority_links(self, new_model)

Expand All @@ -61,7 +62,7 @@ def migrate_to_id(new_id)

# set marc and save
s.marc = new_marc

s.record_type = record_type if record_type
s.paper_trail_event = "#{self.class} change id from #{self.id} to #{new_id}"
s.save
end
Expand Down

0 comments on commit ad2cb73

Please sign in to comment.