Class: Designation
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Designation
- Defined in:
- app/models/designation.rb
Class Method Summary collapse
-
.get_agent_designations(agent) ⇒ Object
Get Agent’s designations.
-
.get_all_designations ⇒ Object
Get All Designations.
Instance Method Summary collapse
Class Method Details
.get_agent_designations(agent) ⇒ Object
Get Agent’s designations
18 19 20 |
# File 'app/models/designation.rb', line 18 def self.get_agent_designations(agent) Hash[*AgentDesignation.where(agent_id: agent.id).joins(:designation).pluck(:designation_id, :designation).flatten] end |
.get_all_designations ⇒ Object
Get All Designations
13 14 15 |
# File 'app/models/designation.rb', line 13 def self.get_all_designations Hash[*Designation.pluck(:id, :designation).flatten] end |
Instance Method Details
#name ⇒ Object
8 9 10 |
# File 'app/models/designation.rb', line 8 def name designation end |