Skip to content

Commit 23d9c3c

Browse files
authored
Merge pull request #2587 from alphagov/dont-copy-made-live-dates-from-form
Do not copy first_made_live_at when copying a form
2 parents 404e5cc + cd601d1 commit 23d9c3c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

app/services/form_copy_service.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
class FormCopyService
22
include LoggingHelper
33

4-
DONT_COPY = %i[created_at updated_at submission_email].freeze
4+
DONT_COPY = %i[created_at updated_at first_made_live_at submission_email].freeze
55
TO_EXCLUDE = Form::ATTRIBUTES_NOT_IN_FORM_DOCUMENT + DONT_COPY
66

77
def initialize(form, logged_in_user)

spec/services/form_copy_service_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@
5454
expect(copied_form.updated_at).not_to eq(source_form.updated_at)
5555
end
5656

57+
it "does not copy attributes that we exclude from copying" do
58+
expect(copied_form.first_made_live_at).to be_nil
59+
expect(copied_form.submission_email).to be_nil
60+
end
61+
5762
context "when source form has completed tasks" do
5863
before do
5964
source_form.update!(

0 commit comments

Comments
 (0)