Sha256: 2cfd766c2356497f030b3bc7f759995690b64170fb0e78290dd151154b170d45
Contents?: true
Size: 820 Bytes
Versions: 20
Compression:
Stored size: 820 Bytes
Contents
# frozen_string_literal: true module Decidim module Initiatives # A form object used to collect the data for a new initiative. class InitiativeForm < Form include TranslatableAttributes mimic :initiative attribute :title, String attribute :description, String attribute :type_id, Integer attribute :scope_id, Integer attribute :decidim_user_group_id, Integer attribute :signature_type, String validates :title, :description, presence: true validates :title, length: { maximum: 150 } validates :signature_type, presence: true validates :type_id, presence: true validates :scope_id, presence: true def map_model(model) self.type_id = model.type.id self.scope_id = model.scope.id end end end end
Version data entries
20 entries across 20 versions & 1 rubygems