Class: ConstructorPages::Template
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- ConstructorPages::Template
- Includes:
- CodeNameUniq
- Defined in:
- 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 28 29 30 31 |
# File 'app/models/constructor_pages/template.rb', line 25 def child if child_id.nil? and !leaf? children.first else Template.find child_id end end |