Class: Language

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

Class Method Summary collapse

Class Method Details

.get_agent_languages(agent) ⇒ Object

Get Agent’s languages



15
16
17
# File 'app/models/language.rb', line 15

def self.get_agent_languages(agent)
  Hash[*AgentLanguage.where(agent_id: agent.id).joins(:language).pluck(:language_id, :name).flatten]
end

.get_all_languagesObject

Get All Languages



10
11
12
# File 'app/models/language.rb', line 10

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