class Decidim::Pages::DataImporter

Importer for Pages specific data (i.e. its page content).

def import(serialized, _user)

Returns:
  • (Decidim::Pages::Page) - The imported page

Parameters:
  • _user (Decidim::User) -- The user performing the import.
  • serialized (Hash) -- The serialized data read from the import file.
def import(serialized, _user)
  return unless serialized
  Page.create!(
    component: @component,
    body: serialized["body"]
  )
end

def initialize(component)

def initialize(component)
  @component = component
end