Class: Maglev::Content::AddSectionService
- Inherits:
-
Object
- Object
- Maglev::Content::AddSectionService
- Includes:
- Injectable, HelpersConcern
- Defined in:
- app/services/maglev/content/add_section_service.rb
Instance Method Summary collapse
Instance Method Details
#call ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/services/maglev/content/add_section_service.rb', line 20 def call raise Maglev::Errors::UnknownSection unless section_definition section_content = build_section_content ActiveRecord::Base.transaction do add_to_site!(section_content) if can_add_to_site? add_to_page!(section_content) if can_add_to_page? end # in case the instance of the service is reused, we need to reset the memoization # this is the case for the setup_pages service reset_memoization section_content end |