Class: ConstructorPages::Template
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- ConstructorPages::Template
- Includes:
- CodeNameUniq
- Defined in:
- pages/app/models/constructor_pages/template.rb
Overview
Template model. Template allows assing different design for pages.
Templates has many fields. For example:
template "Product" should has fields like "price", "description", "size" etc.
Instance Method Summary collapse
-
#child ⇒ Object
Return child corresponding child_id or children first.
Methods included from CodeNameUniq
Instance Method Details
#child ⇒ Object
Return child corresponding child_id or children first
25 26 27 |
# File 'pages/app/models/constructor_pages/template.rb', line 25 def child !child_id && !leaf? ? children.first : self.class.find(child_id) end |