Sha256: 09450c3ccd418a8a01a20e16566e877f5ad43d9ffa2a9fdd2dfcb58c10be5ef9

Contents?: true

Size: 640 Bytes

Versions: 20

Compression:

Stored size: 640 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Initiatives
    module Admin
      # A form object used to collect the all the initiative type attributes.
      class InitiativeTypeForm < Decidim::Form
        include TranslatableAttributes

        mimic :initiatives_type

        translatable_attribute :title, String
        translatable_attribute :description, String
        attribute :banner_image, String

        validates :title, :description, translatable_presence: true
        validates :banner_image, presence: true, if: lambda { |form|
          form.context.initiative_type.nil?
        }
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
decidim-initiatives-0.16.1 app/forms/decidim/initiatives/admin/initiative_type_form.rb
decidim-initiatives-0.16.0 app/forms/decidim/initiatives/admin/initiative_type_form.rb
decidim-initiatives-0.15.2 app/forms/decidim/initiatives/admin/initiative_type_form.rb
decidim-initiatives-0.15.1 app/forms/decidim/initiatives/admin/initiative_type_form.rb
decidim-initiatives-0.15.0 app/forms/decidim/initiatives/admin/initiative_type_form.rb
decidim-initiatives-0.14.4 app/forms/decidim/initiatives/admin/initiative_type_form.rb
decidim-initiatives-0.14.3 app/forms/decidim/initiatives/admin/initiative_type_form.rb
decidim-initiatives-0.14.2 app/forms/decidim/initiatives/admin/initiative_type_form.rb
decidim-initiatives-0.14.1 app/forms/decidim/initiatives/admin/initiative_type_form.rb
decidim-initiatives-0.13.1 app/forms/decidim/initiatives/admin/initiative_type_form.rb
decidim-initiatives-0.12.2 app/forms/decidim/initiatives/admin/initiative_type_form.rb
decidim-initiatives-0.13.0 app/forms/decidim/initiatives/admin/initiative_type_form.rb
decidim-initiatives-0.12.1 app/forms/decidim/initiatives/admin/initiative_type_form.rb
decidim-initiatives-0.13.0.pre1 app/forms/decidim/initiatives/admin/initiative_type_form.rb
decidim-initiatives-0.12.0 app/forms/decidim/initiatives/admin/initiative_type_form.rb
decidim-initiatives-0.11.2 app/forms/decidim/initiatives/admin/initiative_type_form.rb
decidim-initiatives-0.12.0.pre app/forms/decidim/initiatives/admin/initiative_type_form.rb
decidim-initiatives-0.11.1 app/forms/decidim/initiatives/admin/initiative_type_form.rb
decidim-initiatives-0.11.0.pre1 app/forms/decidim/initiatives/admin/initiative_type_form.rb
decidim-initiatives-0.9.1 app/forms/decidim/initiatives/admin/initiative_type_form.rb