Class: CertificateProgram

Inherits:
ApplicationRecord show all
Defined in:
app/models/certificate_program.rb

Instance Method Summary collapse

Methods inherited from ApplicationRecord

active_between, aggregate_of, all_except, defaults, #delete, #destroy!, enum_prefixed_translations_for, numbered, organic_on, resource_fields, #save, #save_and_notify!, #save_and_notify_changes!, serialize_symbolized_hash_array, teaser_on, #update_and_notify!, update_or_create!, whitelist_attributes, with_pg_retry, with_temporary_token

Methods included from WithPgLock

#with_pg_lock

Instance Method Details

#friendlyObject



7
8
9
# File 'app/models/certificate_program.rb', line 7

def friendly
  title
end

#template_html_erbObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'app/models/certificate_program.rb', line 11

def template_html_erb
  self[:template_html_erb] ||= <<HTML
<style>
.qr-code {
  bottom: 5px;
  right: 5px;
  height: 15mm;
  width: 15mm;
}
.name {
  position: absolute;
  width: 100%;
  top: 380px;
  text-align: center;
}
</style>
<!-- You can use interpolations like --
<%#= certificate.started_at %>
<%#= certificate.ended_at %>
<%#= user.formal_first_name %>
<%#= user.formal_last_name %>
<%#= user.formal_full_name %>
<%#= certificate_program.title %>
<%#= certificate_program.description %>
<%#= organization.name %>
<%#= organization.display_name %>
--                                  -->
<section class="name">
  <h1><%= user.formal_full_name %></h1>
</section>
HTML
end