Sha256: ace18896b1268607c7ba3e2291ed84a315eb3b094efaa84abad729ea5f96e52a
Contents?: true
Size: 286 Bytes
Versions: 160
Compression:
Stored size: 286 Bytes
Contents
module WithProfile extend ActiveSupport::Concern module ClassMethods def for_profile(profile) where(uid: profile.uid).first_or_initialize.tap do |user| user.assign_attributes(profile.to_h.compact) user.save_and_notify_changes! end end end end
Version data entries
160 entries across 160 versions & 2 rubygems