Sha256: 9092b298e30c455d97191eb11be108c69e4955a22e6a1e3caad251a3c422e400
Contents?: true
Size: 536 Bytes
Versions: 11
Compression:
Stored size: 536 Bytes
Contents
module Spina module Partable extend ActiveSupport::Concern included do def part(attributes) part = parts.where(name: attributes[:name]).first_or_initialize(attributes) part.partable = part.partable_type.constantize.new if part.partable.blank? part.options = attributes[:options] part end def has_content?(name) content(name).present? end def content(name) part = parts.find_by(name: name) part.try(:content) end end end end
Version data entries
11 entries across 11 versions & 1 rubygems