Skip to content

Commit

Permalink
Add owning_org_content_ids to base_field_keys
Browse files Browse the repository at this point in the history
This is to ensure new editions have owning_org_content_ids copied from existing ones so department users can create new content
  • Loading branch information
baisa committed Jan 7, 2025
1 parent 9865038 commit 7d397de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/models/edition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ def base_field_keys
panopticon_id
overview
slug
owning_org_content_ids
]
end

Expand Down
2 changes: 2 additions & 0 deletions test/models/edition_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,13 @@ def draft_second_edition_from(published_edition)
version_number: 1,
overview: "I am a test overview",
in_beta: true,
owning_org_content_ids: %w[org-1],
)
clone_edition = edition.build_clone
assert_equal "I am a test overview", clone_edition.overview
assert_equal true, clone_edition.in_beta
assert_equal 2, clone_edition.version_number
assert_equal %w[org-1], clone_edition.owning_org_content_ids
end

test "cloning can only occur from a published edition" do
Expand Down

0 comments on commit 7d397de

Please sign in to comment.