Class: Language
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Language
- Defined in:
- app/models/language.rb
Class Method Summary collapse
-
.get_agent_languages(agent) ⇒ Object
Get Agent’s languages.
-
.get_all_languages ⇒ Object
Get All Languages.
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_languages ⇒ Object
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 |