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

Add option to not stash drafted data separately #53

Closed
7 of 8 tasks
chrisdpeters opened this issue Nov 8, 2016 · 1 comment
Closed
7 of 8 tasks

Add option to not stash drafted data separately #53

chrisdpeters opened this issue Nov 8, 2016 · 1 comment
Assignees
Milestone

Comments

@chrisdpeters
Copy link
Collaborator

chrisdpeters commented Nov 8, 2016

There are scenarios where it makes sense to stash drafted data and require reification to get it back. And #51 could potentially make it more performant in most situations.

There are other scenarios where you may be creating a service that is only concerned with drafted data, so reification is not required or necessary. I'm finding myself in that situation with my current project, and I'd imagine that others would too.

This could be done via a setting or by simply removing the object column from the database. I am open to comments about which would be more appropriate. I'm leaning toward making it an explicit setting so that the intention is documented somewhere in the application's source code.

  • Add Draftsman.stash_drafted_changes config option
    • Add to generator
  • Apply new logic to Model#save_draft method
  • Apply new logic to Draft#reify method
  • Apply new logic to Draft#publish! method
  • Apply new logic to Draft#revert! method
  • Apply new logic to Model#draft_destruction - delete record entirely and stash it in Draft
  • Update documentation
@chrisdpeters chrisdpeters added this to the 0.6.0 milestone Nov 8, 2016
@chrisdpeters chrisdpeters self-assigned this Nov 11, 2016
@chrisdpeters chrisdpeters reopened this Nov 16, 2016
@chrisdpeters
Copy link
Collaborator Author

I had added an item to have the new stash_drafted_changes setting affect #draft_destruction, and I just don't think that'll work out. Unfortunately, reverting a draft like that would make it difficult (if not impossible) to restore related records with foreign keys and such. The original record needs to be there until it's deleted for good.

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

No branches or pull requests

1 participant