Module: VAProfile::Concerns::Defaultable

Extended by:
ActiveSupport::Concern
Included in:
Models::BaseAddress, Models::Email, Models::GenderIdentity, Models::Permission, Models::PreferredName, Models::ServiceHistory, Models::Telephone, Models::V3::BaseAddress, Models::VeteranStatus
Defined in:
lib/va_profile/concerns/defaultable.rb

Instance Method Summary collapse

Instance Method Details

#set_defaults(user) ⇒ VAProfile::Models::Base

Sets the included default values

Parameters:

  • user (User)

    The user associated with the transaction

Returns:



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/va_profile/concerns/defaultable.rb', line 13

def set_defaults(user)
  now = Time.zone.now.iso8601

  tap do |record|
    record.attributes = {
      effective_start_date: now,
      source_date: now,
      vet360_id: user.vet360_id,
      source_system_user: user.icn
    }
  end
end