Class: Designation

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

Class Method Summary collapse

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_designationsObject

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

#nameObject



8
9
10
# File 'app/models/designation.rb', line 8

def name
  designation
end