Sha256: 3062176ee6d2db77cc63cee55563dfac3f4f415f43487895a4f3695b613bee32
Contents?: true
Size: 671 Bytes
Versions: 19
Compression:
Stored size: 671 Bytes
Contents
# frozen_string_literal: true require "csv" module Decidim module Admin # A form object used to upload CSV to batch participatory space private users. # class ParticipatorySpacePrivateUserCsvImportForm < Form include Decidim::HasUploadValidations attribute :file attribute :user_name, String attribute :email, String validates :file, presence: true validate :validate_csv def validate_csv return if file.blank? CSV.foreach(file.path) do |_email, user_name| errors.add(:user_name, :invalid) unless user_name.match?(UserBaseEntity::REGEXP_NAME) end end end end end
Version data entries
19 entries across 19 versions & 1 rubygems