Module: Spina::Part

Extended by:
ActiveSupport::Concern
Included in:
LayoutPart, PagePart, StructurePart
Defined in:
app/models/concerns/spina/part.rb

Instance Method Summary collapse

Instance Method Details

#contentObject



19
20
21
# File 'app/models/concerns/spina/part.rb', line 19

def content
  self.partable.try(:content) || self.partable
end

#partable_attributes=(attributes) ⇒ Object



23
24
25
26
27
28
29
# File 'app/models/concerns/spina/part.rb', line 23

def partable_attributes=(attributes)
  if self.partable.present?
    self.partable.assign_attributes(attributes)
  else
    self.partable = self.partable_type.constantize.new(attributes)
  end
end

#to_sObject



15
16
17
# File 'app/models/concerns/spina/part.rb', line 15

def to_s
  name
end