Class: ViewSupportCase

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

Overview

== Schema Information

Table name: view_support_cases
Database name: primary

id :integer primary key
assigned_to_full_name :string(255)
case_number :string
case_type :string(255)
closed_at :datetime
closed_reason :string
creator_full_name :string(255)
description :text
priority :string(255)
state :string(255)
created_at :datetime
assigned_to_id :integer
creator_id :integer

Has many collapse

Has and belongs to many collapse

Class Method Summary collapse

Methods included from Models::SearchableView

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

Methods inherited from ApplicationViewRecord

create, create!, #readonly?

Methods inherited from ApplicationRecord

ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation

Methods included from Models::EventPublishable

#publish_event

Class Method Details

.creators_select_optionsObject



31
32
33
34
# File 'app/models/view_support_case.rb', line 31

def self.creators_select_options
  selected_creators = ViewSupportCase.where('creator_id is not null').select(:creator_full_name, :creator_id).distinct
  selected_creators.sorted.pluck(:creator_full_name, :creator_id)
end

.sortedActiveRecord::Relation<ViewSupportCase>

A relation of ViewSupportCases that are sorted. Active Record Scope

Returns:

See Also:



27
# File 'app/models/view_support_case.rb', line 27

scope :sorted, -> { order(:creator_full_name) }

Instance Method Details

#room_configurationsActiveRecord::Relation<RoomConfiguration>

Returns:

  • (ActiveRecord::Relation<RoomConfiguration>)

See Also:



25
# File 'app/models/view_support_case.rb', line 25

has_and_belongs_to_many :room_configurations, :foreign_key => 'support_case_id', :join_table => "room_configurations_support_cases"

#support_case_participantsActiveRecord::Relation<SupportCaseParticipant>

Returns:

See Also:



24
# File 'app/models/view_support_case.rb', line 24

has_many :support_case_participants, :foreign_key => 'support_case_id'