Class: TemplateItem

Inherits:
CompositionItem show all
Defined in:
app/models/template_item.rb

Overview

A TemplateItem is one part of a reusable Template structure.

Instance Attribute Summary

Attributes inherited from CompositionItem

#composition_id, #composition_item_object_id, #composition_item_object_type, #css_style, #height, #is_visible, #opacity, #parent_id, #position, #project_id, #rotation_z, #svg_clip, #svg_view_box, #text, #total, #type, #width, #x, #y, #z, #zoom

Instance Method Summary collapse

Methods inherited from CompositionItem

#annotates_community_object?, #community_composition_has_no_object, #composition_is_unchanged, #composition_item_object_is_permitted, composition_item_object_permitted?, is_community?, #is_community?, #parent_is_in_composition, #parent_is_not_self_or_descendant, #set_community_project_id

Methods included from Housekeeping

#has_polymorphic_relationship?

Methods inherited from ApplicationRecord

transaction_with_retry

Instance Method Details

#composition_is_template ⇒ Object (protected)



10
11
12
13
14
# File 'app/models/template_item.rb', line 10

def composition_is_template
  if composition && !composition.is_a?(Template)
    errors.add(:composition, 'must be a Template')
  end
end