Sha256: 9fc89fc05121b530ec86084b232f390b3b8aa65aa10dc3b1a0d2b125539d6735
Contents?: true
Size: 589 Bytes
Versions: 93
Compression:
Stored size: 589 Bytes
Contents
module Pageflow class ChapterScaffold def initialize(chapter, options) @chapter = chapter @options = options end delegate :save!, to: :@chapter def build if @options[:depth] == 'page' @page = @chapter.pages.build(template: 'background_image') end self end def as_json(_ = {}) { chapter: @chapter, page: @page } end def to_model @chapter end def self.build(storyline, attributes, options) new(storyline.chapters.build(attributes), options).build end end end
Version data entries
93 entries across 93 versions & 1 rubygems