Sha256: fa265c33cb1e4a3a1c43d64ce4528f2a4aa9fb2c061d6d01fac5ed0f4e1456f8

Contents?: true

Size: 579 Bytes

Versions: 64

Compression:

Stored size: 579 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Amendable
    # A form object used to publish emendations
    class PublishForm < Decidim::Amendable::Form
      mimic :amendment

      attribute :id, Integer
      attribute :amendable_params, Hash
      attribute :emendation_params, Hash

      validates :id, presence: true

      def map_model(model)
        self.amendable_params = model.amendable.attributes.slice(*amendable_fields_as_string)
        self.emendation_params = model.emendation.attributes.slice(*amendable_fields_as_string)
      end
    end
  end
end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
decidim-core-0.29.1 app/forms/decidim/amendable/publish_form.rb
decidim-core-0.28.4 app/forms/decidim/amendable/publish_form.rb
decidim-core-0.27.9 app/forms/decidim/amendable/publish_form.rb
decidim-core-0.29.0 app/forms/decidim/amendable/publish_form.rb
decidim-core-0.28.3 app/forms/decidim/amendable/publish_form.rb
decidim-core-0.27.8 app/forms/decidim/amendable/publish_form.rb
decidim-core-0.29.0.rc4 app/forms/decidim/amendable/publish_form.rb
decidim-core-0.29.0.rc3 app/forms/decidim/amendable/publish_form.rb
decidim-core-0.29.0.rc2 app/forms/decidim/amendable/publish_form.rb
decidim-core-0.29.0.rc1 app/forms/decidim/amendable/publish_form.rb
decidim-core-0.28.2 app/forms/decidim/amendable/publish_form.rb
decidim-core-0.27.7 app/forms/decidim/amendable/publish_form.rb
decidim-core-0.28.1 app/forms/decidim/amendable/publish_form.rb
decidim-core-0.27.6 app/forms/decidim/amendable/publish_form.rb
decidim-core-0.26.10 app/forms/decidim/amendable/publish_form.rb
decidim-core-0.26.9 app/forms/decidim/amendable/publish_form.rb
decidim-core-0.28.0 app/forms/decidim/amendable/publish_form.rb
decidim-core-0.27.5 app/forms/decidim/amendable/publish_form.rb
decidim-core-0.28.0.rc5 app/forms/decidim/amendable/publish_form.rb
decidim-core-0.28.0.rc4 app/forms/decidim/amendable/publish_form.rb