Sha256: 6453fab054d732e64ac4be5db361029323392eb6d0f1e5d802a6f3e893e8a27e
Contents?: true
Size: 592 Bytes
Versions: 8
Compression:
Stored size: 592 Bytes
Contents
# frozen_string_literal: true module PUNK class CreateIdentitiesService < Service def process User.each do |user| if user.email.present? Identity.find_or_create(claim: user.email) do |i| i.claim_type = :email i.user = user end end if user.phone.present? Identity.find_or_create(claim: user.phone) do |i| i.claim_type = :phone i.user = user end end rescue Sequel::ValidationFailed => e logger.warn e.message end nil end end end
Version data entries
8 entries across 8 versions & 1 rubygems