Sha256: 50b6ce7cb84536593590cfcf1038bd91e959a2ea6f40f838f54ac0d7c9807a5d

Contents?: true

Size: 778 Bytes

Versions: 6

Compression:

Stored size: 778 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Conferences
    module Admin
      # A command with all the business logic when creating a new
      # media link for conference in the system.
      class CreateMediaLink < Decidim::Commands::CreateResource
        fetch_form_attributes :title, :link, :weight, :date

        protected

        def resource_class = Decidim::Conferences::MediaLink

        def extra_params
          {
            resource: {
              title: form.title
            },
            participatory_space: {
              title: form.current_participatory_space.title
            }
          }
        end

        def attributes
          super.merge(conference: form.current_participatory_space)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
decidim-conferences-0.29.1 app/commands/decidim/conferences/admin/create_media_link.rb
decidim-conferences-0.29.0 app/commands/decidim/conferences/admin/create_media_link.rb
decidim-conferences-0.29.0.rc4 app/commands/decidim/conferences/admin/create_media_link.rb
decidim-conferences-0.29.0.rc3 app/commands/decidim/conferences/admin/create_media_link.rb
decidim-conferences-0.29.0.rc2 app/commands/decidim/conferences/admin/create_media_link.rb
decidim-conferences-0.29.0.rc1 app/commands/decidim/conferences/admin/create_media_link.rb