Sha256: 628188650f033cf26da2ec5fbaedd23dae524db83f0735a24a0be958cfaf4ccd

Contents?: true

Size: 528 Bytes

Versions: 5

Compression:

Stored size: 528 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Amendable
    # A form object used to promote emendations
    class PromoteForm < Decidim::Amendable::Form
      mimic :amend

      attribute :id, String

      validates :id, presence: true

      def emendation
        @emendation ||= Amendment.find_by(decidim_emendation_id: id).emendation
      end

      def amendable_type
        emendation_type
      end

      def emendation_type
        emendation.resource_manifest.model_class_name
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
decidim-core-0.17.2 app/forms/decidim/amendable/promote_form.rb
decidim-core-0.17.1 app/forms/decidim/amendable/promote_form.rb
decidim-core-0.16.1 app/forms/decidim/amendable/promote_form.rb
decidim-core-0.17.0 app/forms/decidim/amendable/promote_form.rb
decidim-core-0.16.0 app/forms/decidim/amendable/promote_form.rb