Class: Specialty
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Specialty
- Defined in:
- app/models/specialty.rb
Class Method Summary collapse
-
.get_agent_specialties(agent) ⇒ Object
Get Agent’s specialties.
-
.get_all_specialties ⇒ Object
Get All Specialties.
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_specialties ⇒ Object
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 |