-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch fully to documents and editions #683
Merged
Merged
Changes from all commits
Commits
Show all changes
164 commits
Select commit
Hold shift + click to select a range
b1b9f56
Populate documents from content items
thomasleese f4a2088
Update documents and content_items models
thomasleese e09b223
Update model tests
thomasleese e7cbe57
Update queries for new documents table
thomasleese 596b9e8
Update commands for new documents table
thomasleese 577030f
Update queries to include documents table
thomasleese 1d60bb3
Update tests
thomasleese 83e3c2c
Update queries
thomasleese f3f1322
Minor code formatting improvements
thomasleese f08c4c0
Fix unpublish tests
thomasleese e1dac84
Ensure a document is always created
thomasleese 6f37970
Fix formatting issues
thomasleese 0b71cec
Add a note regarding removal of methods
thomasleese ddaa74e
Retrieve the document in a retry loop
thomasleese 62cd742
Lock document row when finding a previous draft
dougdroper 5ce016e
Create a query for looking up a document
thomasleese b9cc2fa
Add 'draft' and 'live' methods to documents
thomasleese c69e775
Include document fields in content item JSON representation
thomasleese 560dec6
Add content_id to approved fields
thomasleese f7d86a5
Fix code style issues
thomasleese 272331c
Update tests to account for content ID validation
thomasleese f229a9a
Add checks for draft and live content items
thomasleese 4c4a770
Update commands to use documents
thomasleese 92d79de
Use content_store to determine live/draft
thomasleese 1f9046f
Use ActiveRecord relations for draft and live
kevindew 86bebbb
Create concern for find_or_create_locked
kevindew 8061aac
Use find_or_create_locked method for locked models
kevindew 1fa4295
Add means of getting previous content item
thomasleese 2e4b39c
Fix field use in state validator
thomasleese ff62a02
Minor code fixes
thomasleese 386b006
Simplify commands to use document
thomasleese 75d1d22
Simplify query to check published base_path conflict
kevindew 1502d19
ContentItem knows about unpublishing relation
kevindew c3b0694
Refactored GetContentItemIdsWithFallbacks query
kevindew 00babf1
Simplify LocalesForContentItems query
kevindew e1d7fa8
Use content_stores rather than states in LocalesForContentItems usage
kevindew f41f707
Add check for invalid UUIDs
thomasleese dc3c704
Simplify get latest query
dougdroper 1aa66d1
Rename document spec
thomasleese 2e7727b
Update publish command after changes in master
thomasleese 2995e9b
Memoize content_item and previous_item
thomasleese d61fe6e
Update code for lock version changes
thomasleese 517b83b
Fix code style error
thomasleese be5b5de
Fix syntax error
thomasleese 72005b4
Update pact tests
thomasleese a158f46
Remove unnecessary assignment
thomasleese 88cc0b5
Fix typo
kevindew 49abb15
Store content_id and locale on content_item
kevindew 6504e48
Brief refactoring to discard_draft
kevindew 6601d1e
Make discard draft tests more document centric
kevindew e1eea7e
Update content_item factory for no lock_version
kevindew c5791fa
Document centric tests for PatchLinkSet Command
kevindew 9cbd928
Document centric spec for PostAction command
kevindew d8b8bcf
Remove content_id and locale from TOP_LEVEL_FIELDS
kevindew e7ff132
Don't reset document_id
kevindew 4882fac
Update content_item_presenter default fields
kevindew 2f09e11
Resolve ambiguous query
kevindew f8d9c26
More document centric PutContent Command spec
kevindew 6ab0ba8
Create documents in RepresentDownstream spec
kevindew c07f1eb
published_or_unpublished relation scope on Document
kevindew 427f850
Don't include locale and content_id in with_draft factory
kevindew b851ae2
Document centric tests for Unpublish command
kevindew 25b9f1a
Use document on BasePathForStateValidator spec
kevindew 5cf4f70
Rename StateForLocaleValidator for Documents
kevindew 092dba4
Rename VersionForLocaleValidator for Documents
kevindew 730badf
Use document in content_item model spec
kevindew 2b8670a
Remove content_id from test
kevindew 7802fdb
Use document in ActionsController spec
kevindew 3669670
Use documents in ContentItemsController spec
kevindew 653494f
Use document in LinkSetsController spec
kevindew 06d17b9
Use document.published_or_unpublished over document.live
kevindew 465f53c
Remove unnecessary migration
thomasleese 31a575b
Update unpublishing_spec to use documents
thomasleese 694da10
Update discard_draft_request_spec to use documents
thomasleese d7b21aa
Update dependency_resolution_helper to use documents
thomasleese eb1dd90
Update reallocating_base_path_spec to use documents
thomasleese 727b67d
Update document usage in ChangeHistoryPresenter
kevindew f1b5a82
Update lookups_spec to use documents
thomasleese b2f13a7
Further updates to tests to make use of documents
thomasleese 8eb5562
Update message_bus_spec to use documents
thomasleese 24683ce
Add a document method on WebContentItems
thomasleese a075a86
Update expanded_links_endpoint_spec to use documents
thomasleese d17384e
Update spec/requests to use documents
thomasleese 9f57160
Correct alphabetical ordering of fields on WebContentItem
kevindew b77090d
ChangeHistoryPresenter consistently uses WebContentItem
kevindew fa35f96
Update spec/workers to use documents
thomasleese 7c88ec3
Fix version_validator_spec to use documents
thomasleese c414a1a
Use document in AvailableTranslations spec
kevindew a5f717a
Include lock_version in content_item_presenter
kevindew 78bc5a6
Add initial spec for debug presenter
thomasleese f40399c
Add more tests for debug presenter
thomasleese 45232dd
Specify factory for create_content_item
kevindew 75f2f0c
Use different interface for create_content_item
kevindew 0adbf47
Use documents in GetContentCollection query
kevindew 0c37694
Various coding consistency updates
kevindew 056d2b0
Use document in GetContentItemIdsWithFallbacks spec
kevindew df587fd
Use documents in GetLatest spec
kevindew 88871f1
Use document in GetLinked spec
kevindew 35c76ea
Use documents in LocalesForContentItems spec
kevindew 30048bf
Fix minor code style issue
thomasleese 3f2f70a
Update pact tests to use documents
thomasleese 8528a21
Fix code style issues
thomasleese 3bfaf50
Various fixes following rebase on master
thomasleese a03918b
Make sure to backfill LockVersion instances
thomasleese a42a2fb
Rename 'ContentItem' to 'Edition'
thomasleese 51fd578
Fix minor code formatting issues
thomasleese 1ac430a
Use 'edition' in AccessLimit
thomasleese a225c14
Use 'edition' in Action
thomasleese 0d552e2
Use 'edition' in ChangeNote
thomasleese 4097515
Rename content_item to edition in UserFacingVersion
kevindew 927c892
Update Document to use editions
thomasleese 30a9274
Update Location to use editions
thomasleese e9b638f
Update state to use editions
thomasleese e28149e
Update factories to use edition
kevindew fc08f10
Use edition in Unpublishing model
kevindew f2ddc71
Rename factories in specs
kevindew 982409b
Improve code consistency
kevindew ba89025
Use edition on Translation model
kevindew 7ccb852
Fix typo in variable name
thomasleese e3fa100
Fix pact tests to use new factories
thomasleese 229b8dc
Rename apperances of 'content_items' to 'editions'
thomasleese ce575a8
Continue rename of content_item to edition
thomasleese 081847c
Fix minor code style issue
thomasleese e91415c
Continue to rename content_item to edition
thomasleese a925bd6
Make content_id and locale private attributes
kevindew 1a3cf6c
Reapproach the as_json additions on Edition
kevindew bee2c62
No longer access content_id and locale directly on Editions
kevindew c7e5091
Fix pact tests
thomasleese 4a202ed
Minor code formatting fix
thomasleese 5466907
Rename more ContentItems to Editions
thomasleese c2f1f8f
Update benchmarking scripts for content item rename
thomasleese 0eb8dd6
Continue renaming content_items to editions
thomasleese ba143aa
Rename spec variables
thomasleese d5a0fc8
Rename content item in strings
kevindew 3fc52fb
Move ContentItem definition into own file
thomasleese 1d2eb5e
Rename query for Edition
thomasleese c90e502
Rename LocalesForContentItems to editions
thomasleese 14a5353
Use reorder so ordering in scope can be acknowledged
kevindew 4fe8e57
Make id non ambiguous
kevindew f8a052c
Remove state scoping at edition level
kevindew 32cbaf9
Remove state from edition criteria
kevindew 3e9fa65
Update details to conform to placeholder schema
kevindew 265ca5a
Update content item in copy to edition/document
kevindew 2e0daa1
Use "edition" terminology instead of "content item"
kevindew 48ed13e
rename import_content_item_events task
kevindew eac1ab1
Use editions rather than content_items in govspeak compare task
kevindew c3f55ec
Use editions rather than content items in descriptions
kevindew 0113dcd
Remove data_cleanup task for Specialist Publisher
kevindew 8601584
Change content_item variable names to edition
kevindew 135890f
Monkey patch ActiveRecord to kill ContentItem class
kevindew 8fb56ac
Use document in put_content refactoring
kevindew 8f3491e
Validate UUID at route level
kevindew cb03463
Update CheckForContentItemPreventingDraftFromBeingPublished class name
kevindew 77265ed
Make FactoryGirl initialisation format consistent
kevindew 8d1c190
Add missing brackets to method calls
kevindew abda3c5
Remove memoization for edition
kevindew 3051eec
Raise an error if retries are exhausted
kevindew e84dd9b
Add a `with_document` scope to Edition
kevindew f81db55
Make ignoring substitute unpublishings easier to understand
kevindew a3153d3
Add parenthesis to make precedence clearer
kevindew e636d9e
Simpler approach to multiline strings
kevindew 045980a
Use exist matchers rather than boolean
kevindew 899016f
Update DeleteContentItem helper
kevindew 159a59f
Remove DefaultAttributes concern
kevindew File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/relavant/relevant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - already got that sorted over here: c877832