Class: Para::Page::Section
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Para::Page::Section
- Defined in:
- app/models/para/page/section.rb
Class Method Summary collapse
-
.section_resource(*args, &block) ⇒ Object
This method is a shortcut to create a has_one through relation.
-
.section_resources(*args, &block) ⇒ Object
This method is a shortcut to create a has_many through relation.
Instance Method Summary collapse
Methods inherited from ApplicationRecord
with_belongs_to_optional_option_if_needed
Class Method Details
.section_resource(*args, &block) ⇒ Object
This method is a shortcut to create a has_one through relation
18 19 20 21 |
# File 'app/models/para/page/section.rb', line 18 def section_resource(*args, &block) _ensure_section_resource_relation _create_section_resource_has_one_relation_for(*args, &block) end |
.section_resources(*args, &block) ⇒ Object
This method is a shortcut to create a has_many through relation
24 25 26 27 |
# File 'app/models/para/page/section.rb', line 24 def section_resources(*args, &block) _ensure_section_resources_relation _create_section_resource_has_many_relation_for(*args, &block) end |
Instance Method Details
#css_class ⇒ Object
12 13 14 |
# File 'app/models/para/page/section.rb', line 12 def css_class @css_class ||= self.class.name.demodulize.underscore.gsub(/_/, '-') end |