Class: Effective::ApplicantReference

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/effective/applicant_reference.rb

Constant Summary collapse

KNOWNS =
['6 months - 1 year', '1 year - 2 years', '2 - 5 years', '5 - 10 years', 'More than 10 years']
RELATIONSHIPS =
['Supervisor', 'Employer', 'Colleague', 'Other']
RECOMMENDATIONS =
['Recommend for Membership', 'Do not recommend for Membership']

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#email_form_skipObject

Returns the value of attribute email_form_skip.



6
7
8
# File 'app/models/effective/applicant_reference.rb', line 6

def email_form_skip
  @email_form_skip
end

Instance Method Details

#complete!Object



85
86
87
88
# File 'app/models/effective/applicant_reference.rb', line 85

def complete!
  completed!
  applicant.save!
end

#notify!Object



78
79
80
81
82
83
# File 'app/models/effective/applicant_reference.rb', line 78

def notify!
  raise('expected reference email') unless email.present?

  EffectiveMemberships.send_email(:applicant_reference_notification, self)
  update!(last_notified_at: Time.zone.now)
end

#to_sObject



74
75
76
# File 'app/models/effective/applicant_reference.rb', line 74

def to_s
  name.presence || 'reference'
end