Sha256: e16ef1410c1a6f3631efe29316539a90e3853e5a19021437bc7b319f03e8d4fe

Contents?: true

Size: 295 Bytes

Versions: 10

Compression:

Stored size: 295 Bytes

Contents

module Spina
  class Structure < ApplicationRecord
    has_one :page_part, as: :page_partable
    has_many :structure_items

    after_save -> { structure_items.each(&:save) }

    accepts_nested_attributes_for :structure_items, allow_destroy: true

    def content
      self
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
spina-1.2.0 app/models/spina/structure.rb
spina-1.1.4 app/models/spina/structure.rb
spina-1.1.3 app/models/spina/structure.rb
spina-1.1.2 app/models/spina/structure.rb
spina-1.1.1 app/models/spina/structure.rb
spina-1.1.0 app/models/spina/structure.rb
spina-1.0.3 app/models/spina/structure.rb
spina-1.0.2 app/models/spina/structure.rb
spina-1.0.1 app/models/spina/structure.rb
spina-1.0.0 app/models/spina/structure.rb