Sha256: 8e29759635a639896f3f1f348696ab57e83c47ec7c20e3151d89dcb14b5bb97b

Contents?: true

Size: 854 Bytes

Versions: 16

Compression:

Stored size: 854 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    # A form object used to update the current organization from the admin
    # dashboard.
    #
    class OrganizationForm < Form
      include TranslatableAttributes

      mimic :organization

      attribute :name, String
      attribute :reference_prefix, String
      attribute :twitter_handler, String
      attribute :facebook_handler, String
      attribute :instagram_handler, String
      attribute :youtube_handler, String
      attribute :github_handler, String
      attribute :default_locale, String

      validates :name, presence: true
      validates :default_locale, presence: true
      validates :default_locale, inclusion: { in: :available_locales }

      private

      def available_locales
        current_organization.available_locales
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
decidim-admin-0.10.1 app/forms/decidim/admin/organization_form.rb
decidim-admin-0.10.0 app/forms/decidim/admin/organization_form.rb
decidim-admin-0.9.3 app/forms/decidim/admin/organization_form.rb
decidim-admin-0.9.2 app/forms/decidim/admin/organization_form.rb
decidim-admin-0.9.1 app/forms/decidim/admin/organization_form.rb
decidim-admin-0.9.0 app/forms/decidim/admin/organization_form.rb
decidim-admin-0.8.4 app/forms/decidim/admin/organization_form.rb
decidim-admin-0.8.3 app/forms/decidim/admin/organization_form.rb
decidim-admin-0.8.2 app/forms/decidim/admin/organization_form.rb
decidim-admin-0.8.1 app/forms/decidim/admin/organization_form.rb
decidim-admin-0.8.0 app/forms/decidim/admin/organization_form.rb
decidim-admin-0.7.4 app/forms/decidim/admin/organization_form.rb
decidim-admin-0.7.3 app/forms/decidim/admin/organization_form.rb
decidim-admin-0.7.2 app/forms/decidim/admin/organization_form.rb
decidim-admin-0.7.1 app/forms/decidim/admin/organization_form.rb
decidim-admin-0.7.0 app/forms/decidim/admin/organization_form.rb