Sha256: 41257e979cddd8267b79e3ff500b8a0f7513527c56306d659b76d50e5ae5cb1c
Contents?: true
Size: 415 Bytes
Versions: 1
Compression:
Stored size: 415 Bytes
Contents
module KnowledgeBase::Concerns::Models::Section extend ActiveSupport::Concern included do # It sounds wrong that a section "belongs to" a sectionable, but we want the foreign # key to be on this side and declaring `belongs_to` is the only way to do that. belongs_to :sectionable, polymorphic: true belongs_to :container, polymorphic: true validates :sectionable, presence: true end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
knowledge_base-0.2.0 | lib/knowledge_base/concerns/models/section.rb |