Skip to content
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

Each piece of content should have an edit history #57

Closed
drusepth opened this issue Sep 28, 2016 · 3 comments
Closed

Each piece of content should have an edit history #57

drusepth opened this issue Sep 28, 2016 · 3 comments

Comments

@drusepth
Copy link
Member

Whenever anything changes on a piece of content, we should create some kind of EditedContentEvent that tracks what changes were made, by whom, and when. That way, we can also have an "edit history" page for content that lets users see who made changes (especially when universes can have multiple collaborators, #25), and be able to revert undesirable/mistaken changes more easily.

@heydonovan
Copy link
Contributor

Have you checked out the paper_trail or audited gem?

@drusepth
Copy link
Member Author

drusepth commented Jul 11, 2017

Implementation:

  • Whenever a Universe, Character, Location, Item, Creature, Race, Religion, Group, Magic, Language, or Scene is created or edited, a ContentChangeEvent should be created with the following properties:
    • user_id - ID of the user making the change
    • changed_fields - hash of field changes (e.g. old and new values), probably best to grab from dirty_fields during the save hook
    • created_at - automatically set, self explanatory
    • action - create, edit, or delete
    • content_id - the ID of the associated content, e.g. 5 or 8185
    • content_type - the content type, e.g. :character, :location, :race, etc

When visiting a content's page in the notebook, there should be an additional pane tab for "Changelog" (similar to the Gallery setup, which needs refactored eventually with a new design). Opening this pane should show a timeline consisting of:

  • The date/time this piece of content was created, and by which user (user_id on the content itself)
  • Any ContentChangeEvents associated with this content with a diff view of which fields changed and what their old and new values were (probably need some cleanup here later, but lets just show it all for now)

Whenever a non-Universe piece of content is deleted, we should create a ContentChangeEvent for its universe (if any) that says that content and content type was deleted (e.g. "Character Bob was deleted by Alice") for display on the universe's Changelog pane.

@drusepth drusepth moved this from Baking to Ready for Development in Freelance Priority Jul 11, 2017
@drusepth drusepth moved this from Ready for Development to Done in Freelance Priority Jul 14, 2017
@drusepth
Copy link
Member Author

This is done and live. Improvements should have separate issues. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

2 participants