-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
Let's say you have an Article, and inside an article you have many Steps (think of a how-to wikihow article)
I was able to make a draft for the article, but I can't do something like "Article.first.draft.steps"
What would be the best way to set up the draft associations for the parent and children models? Would I need to create a Step::Draft table as well?
I did this
#Article.rb model
has_draft do
has_many :step_drafts, order: 'position ASC'
accepts_nested_attributes_for :step_drafts, allow_destroy: true
end
and tried creating a draft of the step:
Article.first.draft.step_drafts.new
but get this error
NameError: uninitialized constant Article::Draft::StepDraft
Metadata
Metadata
Assignees
Labels
No labels