Sha256: 7356bd01eec471312f7f7736542083bfef9af175ac493009ee16742e869eb98d
Contents?: true
Size: 422 Bytes
Versions: 22
Compression:
Stored size: 422 Bytes
Contents
module Spina class StructureItem < ActiveRecord::Base belongs_to :structure has_many :structure_parts, dependent: :destroy scope :sorted_by_structure, -> { order('position') } accepts_nested_attributes_for :structure_parts, allow_destroy: true def content(structure_part) structure_part = structure_parts.where(name: structure_part).first structure_part.try(:content) end end end
Version data entries
22 entries across 22 versions & 1 rubygems