Sha256: 3d271b72232d5dadd86b2408be76d7cd937a3786cc03de4e744e266d0133731b

Contents?: true

Size: 792 Bytes

Versions: 53

Compression:

Stored size: 792 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Meetings
    module Admin
      # A form object used to invite users to join a meeting.
      #
      class MeetingRegistrationInviteForm < Form
        attribute :name, String
        attribute :email, String
        attribute :user_id, Integer
        attribute :existing_user, Boolean, default: false

        validates :name, presence: true, unless: proc { |object| object.existing_user }
        validates :email, presence: true, 'valid_email_2/email': { disposable: true }, unless: proc { |object| object.existing_user }
        validates :user, presence: true, if: proc { |object| object.existing_user }

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

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
decidim-meetings-0.26.10 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.26.9 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.26.8 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.26.7 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.26.5 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.26.4 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.26.3 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.26.2 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.26.1 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.26.0 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.26.0.rc2 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.26.0.rc1 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.25.2 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.25.1 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.25.0 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.25.0.rc4 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.25.0.rc3 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.25.0.rc2 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.25.0.rc1 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.24.3 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb