Class: ViewSupportCase
- Inherits:
-
ApplicationViewRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- ApplicationViewRecord
- ViewSupportCase
- 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
- .creators_select_options ⇒ Object
-
.sorted ⇒ ActiveRecord::Relation<ViewSupportCase>
A relation of ViewSupportCases that are sorted.
Methods included from Models::SearchableView
#crm_link, #crm_link_subtitle, #has_columns?, #main_resource, #readonly?
Methods inherited from ApplicationViewRecord
Methods inherited from ApplicationRecord
ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation
Methods included from Models::EventPublishable
Class Method Details
.creators_select_options ⇒ Object
31 32 33 34 |
# File 'app/models/view_support_case.rb', line 31 def self. 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 |
.sorted ⇒ ActiveRecord::Relation<ViewSupportCase>
A relation of ViewSupportCases that are sorted. Active Record Scope
27 |
# File 'app/models/view_support_case.rb', line 27 scope :sorted, -> { order(:creator_full_name) } |
Instance Method Details
#room_configurations ⇒ ActiveRecord::Relation<RoomConfiguration>
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_participants ⇒ ActiveRecord::Relation<SupportCaseParticipant>
24 |
# File 'app/models/view_support_case.rb', line 24 has_many :support_case_participants, :foreign_key => 'support_case_id' |