Class: Label

Inherits:
ApplicationRecord
  • Object
show all
Defined in:
app/models/label.rb

Class Method Summary collapse

Class Method Details

.get(name, lang = "en") ⇒ Object



7
8
9
# File 'app/models/label.rb', line 7

def self.get(name, lang="en")
  self.where(value: name, lang: lang).first_or_create
end

.instantiate_defaultsObject



3
4
5
# File 'app/models/label.rb', line 3

def self.instantiate_defaults
  %w(Home Work Cell).each {|v| self.get(v)}
end