Class: ConstructorPages::Template

Inherits:
ActiveRecord::Base
  • Object
show all
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

Methods included from CodeNameUniq

#code_name_uniqueness

Instance Method Details

#childObject

Return child corresponding child_id or children first


25
26
27
# File 'app/models/constructor_pages/template.rb', line 25

def child
  Template.find(child_id) if child_id
end

#to_accusativeObject

Convert name to accusative


30
31
32
# File 'app/models/constructor_pages/template.rb', line 30

def to_accusative
  self.name.mb_chars.downcase.to_s.accusative
end