Sha256: df3f9b9477e17996837bd5d602524f8fb5c5b5920b9142a38f062a096021dd4d
Contents?: true
Size: 802 Bytes
Versions: 13
Compression:
Stored size: 802 Bytes
Contents
# frozen_string_literal: true module Decidim module Verifications class CsvDatum < ApplicationRecord belongs_to :organization, foreign_key: :decidim_organization_id, class_name: "Decidim::Organization" validates :email, format: { with: ::Devise.email_regexp } def self.inside(organization) where(organization:) end def self.search_user_email(organization, email) inside(organization) .where(email:) .order(created_at: :desc, id: :desc) .first end def self.insert_all(organization, values) values.each { |value| create(email: value, organization:) } end def self.clear(organization) inside(organization).delete_all end end end end
Version data entries
13 entries across 13 versions & 1 rubygems