Sha256: b8d7c6a2843b82df07f4cd5ccceb6990266a0f593f45b26cacaaff89a5316c8d
Contents?: true
Size: 834 Bytes
Versions: 51
Compression:
Stored size: 834 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: organization) end def self.search_user_email(organization, email) inside(organization) .where(email: email) .order(created_at: :desc, id: :desc) .first end def self.insert_all(organization, values) values.each { |value| create(email: value, organization: organization) } end def self.clear(organization) inside(organization).delete_all end end end end
Version data entries
51 entries across 51 versions & 1 rubygems