Sha256: c1e33f2487c32da0b2a52a8b94c3fbd005f318be9f0ac60d17bcdeb142a3da2a
Contents?: true
Size: 334 Bytes
Versions: 2
Compression:
Stored size: 334 Bytes
Contents
module KnowledgeBase class Section < ActiveRecord::Base # 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 end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
knowledge_base-0.1.0 | app/models/knowledge_base/section.rb |
knowledge_base-0.0.3 | app/models/knowledge_base/section.rb |