Sha256: 4244e91eb999dea4973ce273a27b3849b93ab8b9f9169b1f985ff78018e7e653

Contents?: true

Size: 588 Bytes

Versions: 36

Compression:

Stored size: 588 Bytes

Contents

class Certificate < ApplicationRecord
  include WithGeneratedCode

  belongs_to :user
  belongs_to :certificate_program

  has_one :organization, through: :certificate_program

  delegate :title, :description, :template_html_erb, :background_image_url, to: :certificate_program

  def self.code_size
    12
  end

  def filename
    "#{title.parameterize.underscore}.pdf"
  end

  def template_locals
    { user: user,
      certificate_program: certificate_program,
      organization: organization,
      certificate: self }
  end

  def for_user?(user)
    self.user == user
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
mumuki-domain-9.23.0 app/models/certificate.rb
mumuki-domain-9.22.1 app/models/certificate.rb
mumuki-domain-9.22.0 app/models/certificate.rb
mumuki-domain-9.21.0 app/models/certificate.rb
mumuki-domain-9.20.0 app/models/certificate.rb
mumuki-domain-9.19.0 app/models/certificate.rb
mumuki-domain-9.18.0 app/models/certificate.rb
mumuki-domain-9.17.0 app/models/certificate.rb
mumuki-domain-9.16.0 app/models/certificate.rb
mumuki-domain-9.15.0 app/models/certificate.rb
mumuki-domain-9.14.1 app/models/certificate.rb
mumuki-domain-9.14.0 app/models/certificate.rb
mumuki-domain-9.13.1 app/models/certificate.rb
mumuki-domain-9.13.0 app/models/certificate.rb
mumuki-domain-9.12.0 app/models/certificate.rb
mumuki-domain-9.11.0 app/models/certificate.rb
mumuki-domain-9.10.0 app/models/certificate.rb
mumuki-domain-9.9.0 app/models/certificate.rb
mumuki-domain-9.8.1 app/models/certificate.rb
mumuki-domain-9.8.0 app/models/certificate.rb