Class: Specialty

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/specialty.rb

Class Method Summary collapse

Class Method Details

.get_agent_specialties(agent) ⇒ Object

Get Agent’s specialties



14
15
16
# File 'app/models/specialty.rb', line 14

def self.get_agent_specialties(agent)
  Hash[*AgentSpecialty.where(agent_id: agent.id).joins(:specialty).pluck(:specialty_id, :name).flatten]
end

.get_all_specialtiesObject

Get All Specialties



9
10
11
# File 'app/models/specialty.rb', line 9

def self.get_all_specialties
  Hash[*Specialty.pluck(:id, :name).flatten]
end