Sha256: d103874e09f0b26bd11d00310d649394da0e130b1b354ad1bb9ad311e5287eb1
Contents?: true
Size: 623 Bytes
Versions: 12
Compression:
Stored size: 623 Bytes
Contents
# frozen_string_literal: true module Decidim module Admin # A form object used to promote managed users from the admin dashboard. # class ManagedUserPromotionForm < Form attribute :email, String validates :email, presence: true, "valid_email_2/email": { disposable: true } validate :unique_email private def unique_email return true if Decidim::User.where( organization: context.current_organization, email: email ).where.not(id: context.current_user.id).empty? errors.add :email, :taken false end end end end
Version data entries
12 entries across 12 versions & 1 rubygems