Sha256: a16b1f4e8db9e80ba4ac75f59e3758d399e52a7e6c6222e40275c6033dbf9887

Contents?: true

Size: 532 Bytes

Versions: 38

Compression:

Stored size: 532 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Elections
    module Admin
      # This class holds a form to add users as trustees from Decidim's admin panel.
      class TrusteesParticipatorySpaceForm < Decidim::Form
        attribute :user_id, Integer

        validates :user_id, :user, presence: true

        def map_model(trustee)
          self.user_id = trustee.decidim_user_id
        end

        def user
          @user ||= current_organization.users.find_by(id: user_id)
        end
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
decidim-elections-0.28.4 app/forms/decidim/elections/admin/trustees_participatory_space_form.rb
decidim-elections-0.27.9 app/forms/decidim/elections/admin/trustees_participatory_space_form.rb
decidim-elections-0.28.3 app/forms/decidim/elections/admin/trustees_participatory_space_form.rb
decidim-elections-0.27.8 app/forms/decidim/elections/admin/trustees_participatory_space_form.rb
decidim-elections-0.28.2 app/forms/decidim/elections/admin/trustees_participatory_space_form.rb
decidim-elections-0.27.7 app/forms/decidim/elections/admin/trustees_participatory_space_form.rb
decidim-elections-0.28.1 app/forms/decidim/elections/admin/trustees_participatory_space_form.rb
decidim-elections-0.27.6 app/forms/decidim/elections/admin/trustees_participatory_space_form.rb
decidim-elections-0.26.10 app/forms/decidim/elections/admin/trustees_participatory_space_form.rb
decidim-elections-0.26.9 app/forms/decidim/elections/admin/trustees_participatory_space_form.rb
decidim-elections-0.28.0 app/forms/decidim/elections/admin/trustees_participatory_space_form.rb
decidim-elections-0.27.5 app/forms/decidim/elections/admin/trustees_participatory_space_form.rb
decidim-elections-0.28.0.rc5 app/forms/decidim/elections/admin/trustees_participatory_space_form.rb
decidim-elections-0.28.0.rc4 app/forms/decidim/elections/admin/trustees_participatory_space_form.rb
decidim-elections-0.26.8 app/forms/decidim/elections/admin/trustees_participatory_space_form.rb
decidim-elections-0.27.4 app/forms/decidim/elections/admin/trustees_participatory_space_form.rb
decidim-elections-0.27.3 app/forms/decidim/elections/admin/trustees_participatory_space_form.rb
decidim-elections-0.26.7 app/forms/decidim/elections/admin/trustees_participatory_space_form.rb
decidim-elections-0.26.5 app/forms/decidim/elections/admin/trustees_participatory_space_form.rb
decidim-elections-0.27.2 app/forms/decidim/elections/admin/trustees_participatory_space_form.rb