Add #save_draft method to classes initialized with #has_drafts
Closed this issue · 1 comments
Like AR's #save
, it should intelligently call #draft_creation
or #draft_update
based on the state of the object being drafted.
Idea originally from #46.
@npafundi I think that this is a good move for the API of this gem. It is a little confusing knowing when to call #draft_creation
vs. #draft_update
.
However, this could potentially affect how we do callbacks. If drafting behavior is moved into a single method, I'm not convinced that it would be clear to users of this gem when *_draft_creation
vs. *_draft_update
callbacks would be triggered. I think it's a little ambiguous: is before_draft_creation
called when a draft
record is being first created? Or is it when the item
is created? See what I mean?
So I must ask, which of the callbacks are you using right now? Would you miss anything if I removed the ambiguous ones and created more general before_save_draft
, after_save_draft
, and around_save_draft
callbacks?