Skip to content

Commit

Permalink
Mark attachments as not safely resluggable when editioned
Browse files Browse the repository at this point in the history
When a new edition is created, we duplicate all the attachment
attributes. The copied attachments are no longer safely reslugged as the
URLs have previously been published.
  • Loading branch information
brucebolt committed Jan 12, 2021
1 parent c3b17b5 commit 8cb4da0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/models/attachment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ def publishing_api_details_for_format
end

def deep_clone
dup
dup.tap do |clone|
clone.safely_resluggable = false
end
end

def external?
Expand Down

0 comments on commit 8cb4da0

Please sign in to comment.