Sha256: 235cb04920db4a2ee82f060fea11319af2afc3552f87a203181b40d288cf2cc8
Contents?: true
Size: 481 Bytes
Versions: 14
Compression:
Stored size: 481 Bytes
Contents
module DiscoApp::Concerns::User extend ActiveSupport::Concern included do belongs_to :shop def self.create_user(shopify_user, shop) user = self.find_or_create_by!(id: shopify_user.id, shop: shop) user.update( first_name: shopify_user.first_name || '', last_name: shopify_user.last_name || '', email: shopify_user.email ) user rescue ActiveRecord::RecordNotUnique, PG::UniqueViolation retry end end end
Version data entries
14 entries across 14 versions & 1 rubygems