Class: ViewCertification

Inherits:
ApplicationViewRecord show all
Includes:
Models::SearchableView
Defined in:
app/models/view_certification.rb

Overview

== Schema Information

Table name: view_certifications
Database name: primary

id :bigint primary key
certification_name :string
certification_reference :string
certification_state :string
completion_date :datetime
customer_name :string(255)
enrollment_date :datetime
passed_email_reminder_sent :boolean
passed_email_reminder_sent_at :datetime
passed_email_sent :boolean
passed_email_sent_at :datetime
state :string
certification_id :bigint
course_id :integer
customer_id :integer
party_id :integer

Constant Summary

Constants included from Schedulable

Schedulable::SIMPLE_FORM_OPTIONS

Class Method Summary collapse

Methods included from Models::SearchableView

#crm_link, #crm_link_subtitle, #has_columns?, #readonly?

Methods inherited from ApplicationViewRecord

create, create!, #readonly?

Methods inherited from ApplicationRecord

ransackable_associations, ransackable_attributes, ransortable_attributes, #to_relation

Methods included from Schedulable

config

Methods included from Models::AfterCommittable

#after_commit

Methods included from Models::EventPublishable

#publish_event

Class Method Details

.certification_stateActiveRecord::Relation<ViewCertification>

A relation of ViewCertifications that are certification state. Active Record Scope

Returns:

See Also:



28
29
30
31
32
# File 'app/models/view_certification.rb', line 28

scope :certification_state, ->(states) {
  states = Array(states).map { |s| s == 'ongoing' ? nil : s }
  base = where(certification_state: states.compact)
  states.include?(nil) ? base.or(where(certification_state: nil)) : base
}

.ransackable_scopes(_auth_object = nil) ⇒ Object



34
35
36
# File 'app/models/view_certification.rb', line 34

def self.ransackable_scopes(_auth_object = nil)
  super + %i[certification_state]
end