Class: Spina::PagePart
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Spina::PagePart
show all
- Includes:
- ApplicationHelper
- Defined in:
- app/models/spina/page_part.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
#captcha, #current_account, #error_explanation!, #image_tag_with_at2x, #link_to_add_fields, #markdown
Instance Attribute Details
#position(theme) ⇒ Object
Returns the value of attribute position.
9
10
11
|
# File 'app/models/spina/page_part.rb', line 9
def position
@position
end
|
Instance Method Details
#content ⇒ Object
27
28
29
|
# File 'app/models/spina/page_part.rb', line 27
def content
self.page_partable.try(:content) || self.page_partable
end
|
#page_partable_attributes=(attributes) ⇒ Object
31
32
33
34
35
36
37
|
# File 'app/models/spina/page_part.rb', line 31
def page_partable_attributes=(attributes)
if self.page_partable.present?
self.page_partable.assign_attributes(attributes)
else
self.page_partable = self.page_partable_type.constantize.new(attributes)
end
end
|
#partable_type ⇒ Object
39
40
41
|
# File 'app/models/spina/page_part.rb', line 39
def partable_type
page_partable_type
end
|
#to_s ⇒ Object
18
19
20
|
# File 'app/models/spina/page_part.rb', line 18
def to_s
name
end
|