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.17.2 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.18.0 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.17.1 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.16.1 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.17.0 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.16.0 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.15.2 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.15.1 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.15.0 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.14.4 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.14.3 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.14.2 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb
decidim-meetings-0.14.1 app/forms/decidim/meetings/admin/meeting_registration_invite_form.rb