Module: VAProfile::Concerns::Expirable

Extended by:
ActiveSupport::Concern
Included in:
Models::BaseAddress, Models::Email, Models::Permission, Models::Telephone, Models::V3::BaseAddress
Defined in:
lib/va_profile/concerns/expirable.rb

Instance Method Summary collapse

Instance Method Details

#effective_end_date_has_passedVAProfile::Models::Base (private)

Raises validation error if the model’s effective_end_date is past

Parameters:

  • user (User)

    The user associated with the transaction

Returns:



19
20
21
22
23
# File 'lib/va_profile/concerns/expirable.rb', line 19

def effective_end_date_has_passed
  if effective_end_date.present? && (effective_end_date > Time.zone.now)
    errors.add(:effective_end_date, 'must be in the past')
  end
end