Class: Refinery::Jobs::Setting

Inherits:
Setting
  • Object
show all
Defined in:
app/models/refinery/jobs/setting.rb

Class Method Summary collapse

Class Method Details

.confirmation_bodyObject



8
9
10
11
12
# File 'app/models/refinery/jobs/setting.rb', line 8

def confirmation_body
  find_or_set(:job_application_confirmation_body,
    "Thank you for your job application %name%,\n\nThis email is a receipt to confirm we have received your job application and we'll be in touch shortly.\n\nThanks."
  )
end

.confirmation_message(locale = 'en') ⇒ Object



30
31
32
# File 'app/models/refinery/jobs/setting.rb', line 30

def confirmation_message(locale='en')
  find_or_set(:"job_application_confirmation_message_#{locale}", confirmation_body, scoping: "jobs")
end

.confirmation_message=(locales_messages) ⇒ Object



34
35
36
37
38
39
40
41
# File 'app/models/refinery/jobs/setting.rb', line 34

def confirmation_message=(locales_messages)
  locales_messages.each do |locale, message|
    set(:"job_application_confirmation_message_#{locale}", {
      value: message,
      scoping: "jobs"
    })
  end
end

.confirmation_subject(locale = 'en') ⇒ Object



14
15
16
17
18
19
# File 'app/models/refinery/jobs/setting.rb', line 14

def confirmation_subject(locale='en')
  find_or_set(:"job_application_confirmation_subject_#{locale}",
    "Thank you for your job application",
    scoping: "jobs"
  )
end

.confirmation_subject=(locales_subjects) ⇒ Object



21
22
23
24
25
26
27
28
# File 'app/models/refinery/jobs/setting.rb', line 21

def confirmation_subject=(locales_subjects)
  locales_subjects.each do |locale, subject|
    set(:"job_application_confirmation_subject_#{locale}", {
      value: subject,
      scoping: "jobs"
    })
  end
end

.notification_recipientsObject



43
44
45
46
# File 'app/models/refinery/jobs/setting.rb', line 43

def notification_recipients
  recipients = ((Role[:refinery].users.first.email rescue nil) if defined?(Role)).to_s
  find_or_set(:job_application_notification_recipients, recipients, scoping: "jobs")
end

.notification_recipients=(recipients) ⇒ Object



48
49
50
51
52
53
# File 'app/models/refinery/jobs/setting.rb', line 48

def notification_recipients=(recipients)
  set(:job_application_notification_recipients, {
    value: recipients,
    scoping: "jobs"
  })
end

.notification_subjectObject



55
56
57
# File 'app/models/refinery/jobs/setting.rb', line 55

def notification_subject
  find_or_set(:job_application_notification_subject, "New job application from your website", scoping: "jobs")
end

.send_confirmation?Boolean

Returns:

  • (Boolean)


59
60
61
# File 'app/models/refinery/jobs/setting.rb', line 59

def send_confirmation?
  find_or_set(:job_application_send_confirmation, true, scoping: "jobs")
end