Sha256: 3f020b37f7487c6749978663bf78319ae77d8ef1b110a3f4481334a05210bd6a
Contents?: true
Size: 549 Bytes
Versions: 75
Compression:
Stored size: 549 Bytes
Contents
# frozen_string_literal: true module Renalware module HD class ReviseHDProfile attr_reader :profile, :new_profile def initialize(profile) raise(ArgumentError, "Cannot revise a new Profile") unless profile.persisted? @profile = profile end def call(params) profile.assign_attributes(params) return true unless profile.changed? return false unless profile.valid? profile.restore_attributes @new_profile = profile.supersede!(params) end end end end
Version data entries
75 entries across 75 versions & 1 rubygems