Sha256: c2c69fee0abc85a4a2c0bed9a5630439e391043732905fe7c975ec39291411f3
Contents?: true
Size: 725 Bytes
Versions: 13
Compression:
Stored size: 725 Bytes
Contents
module PageflowScrolled class Section < Pageflow::ApplicationRecord include Pageflow::SerializedConfiguration include Pageflow::AutoGeneratedPermaId belongs_to :chapter has_many :content_elements, -> { order('pageflow_scrolled_content_elements.position ASC') }, dependent: :destroy, inverse_of: :section def self.all_for_revision(revision) joins(chapter: {storyline: :revision}) .where(pageflow_scrolled_storylines: {revision_id: revision}) end def copy_to(chapter) section = dup chapter.sections << section content_elements.each do |content_element| content_element.copy_to(section) end end end end
Version data entries
13 entries across 13 versions & 1 rubygems