Sha256: 3de1b73bf17ad4932f2fe966faa343f0c3675bd08e1ddffb969638ecff4a6ebb
Contents?: true
Size: 786 Bytes
Versions: 28
Compression:
Stored size: 786 Bytes
Contents
# frozen_string_literal: true module Decidim module Pages # Importer for Pages specific data (i.e. its page content). class DataImporter < Decidim::Importers::Importer def initialize(component) @component = component end # Creates a new Decidim::Pages::Page associated to the given **component** # for the serialized page object. # # @param serialized [Hash] The serialized data read from the import file. # @param _user [Decidim::User] The user performing the import. # @return [Decidim::Pages::Page] The imported page def import(serialized, _user) return unless serialized Page.create!( component: @component, body: serialized["body"] ) end end end end
Version data entries
28 entries across 28 versions & 1 rubygems