Module: Drafter::Creation
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/drafter/creation.rb
Overview
class.
Instance Method Summary collapse
-
#save_draft(parent_draft = nil, parent_association_name = nil) ⇒ Object
Build and save the draft when told to do so.
Instance Method Details
#save_draft(parent_draft = nil, parent_association_name = nil) ⇒ Object
Build and save the draft when told to do so.
14 15 16 17 18 19 20 |
# File 'lib/drafter/creation.rb', line 14 def save_draft(parent_draft=nil, parent_association_name=nil) if valid? do_create_draft(parent_draft, parent_association_name) create_subdrafts end return self.draft.reload if self.draft end |