Class: Maglev::Content::DeleteSectionService

Inherits:
Object
  • Object
show all
Includes:
Injectable, HelpersConcern
Defined in:
app/services/maglev/content/delete_section_service.rb

Instance Method Summary collapse

Instance Method Details

#callObject



15
16
17
18
19
20
21
22
23
# File 'app/services/maglev/content/delete_section_service.rb', line 15

def call
  raise Maglev::Errors::UnknownSection unless section_definition

  ActiveRecord::Base.transaction do
    # we never delete site scoped sections:
    # A page might not need it anymore but others might still need it.
    delete_section!(page)
  end
end