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



100
101
102
103
# File 'app/models/effective/applicant_reference.rb', line 100

def complete!
  completed!
  applicant.save!
end

#notify!Object



93
94
95
96
97
98
# File 'app/models/effective/applicant_reference.rb', line 93

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

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

#reportable_scopesObject

effective_reports



57
58
59
# File 'app/models/effective/applicant_reference.rb', line 57

def reportable_scopes
  { in_progress: nil, done: nil, expired: nil }
end

#to_sObject



89
90
91
# File 'app/models/effective/applicant_reference.rb', line 89

def to_s
  name.present? ? "#{model_name.human} from #{name}" : model_name.human
end