Sha256: c8f2f3c77a9a845b64f38ddd065a11536e6813ae74c43bfd7b492b3cff2c3128

Contents?: true

Size: 537 Bytes

Versions: 64

Compression:

Stored size: 537 Bytes

Contents

# frozen_string_literal: true

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

      attribute :id, Integer
      attribute :emendation_params, Hash

      validates :id, presence: true
      validate :emendation_must_change_amendable
      validate :amendable_form_must_be_valid

      def map_model(model)
        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.26.8 app/forms/decidim/amendable/review_form.rb
decidim-core-0.27.4 app/forms/decidim/amendable/review_form.rb
decidim-core-0.27.3 app/forms/decidim/amendable/review_form.rb
decidim-core-0.26.7 app/forms/decidim/amendable/review_form.rb
decidim-core-0.26.5 app/forms/decidim/amendable/review_form.rb
decidim-core-0.27.2 app/forms/decidim/amendable/review_form.rb
decidim-core-0.27.1 app/forms/decidim/amendable/review_form.rb
decidim-core-0.26.4 app/forms/decidim/amendable/review_form.rb
decidim-core-0.27.0 app/forms/decidim/amendable/review_form.rb
decidim-core-0.26.3 app/forms/decidim/amendable/review_form.rb
decidim-core-0.27.0.rc2 app/forms/decidim/amendable/review_form.rb
decidim-core-0.27.0.rc1 app/forms/decidim/amendable/review_form.rb
decidim-core-0.26.2 app/forms/decidim/amendable/review_form.rb
decidim-core-0.26.1 app/forms/decidim/amendable/review_form.rb
decidim-core-0.26.0 app/forms/decidim/amendable/review_form.rb
decidim-core-0.26.0.rc2 app/forms/decidim/amendable/review_form.rb
decidim-core-0.26.0.rc1 app/forms/decidim/amendable/review_form.rb
decidim-core-0.25.2 app/forms/decidim/amendable/review_form.rb
decidim-core-0.25.1 app/forms/decidim/amendable/review_form.rb
decidim-core-0.25.0 app/forms/decidim/amendable/review_form.rb