Class: Optimacms::Language

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

Class Method Summary collapse

Class Method Details

.get_id_by_name(name) ⇒ Object


22
23
24
25
26
27
# File 'app/models/optimacms/language.rb', line 22

def self.get_id_by_name(name)
  self.where(lang: name).first.id

rescue
  nil
end

.list_allObject


17
18
19
# File 'app/models/optimacms/language.rb', line 17

def self.list_all
  rows = Language.admin_enabled.all.map(&:lang)
end

.list_with_defaultObject


12
13
14
15
# File 'app/models/optimacms/language.rb', line 12

def self.list_with_default
  rows = ['']+list_all

end