Class: Atreides::Site

Inherits:
Base
  • Object
show all
Includes:
Extendable
Defined in:
app/models/atreides/site.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#dom_id, #to_param

Class Method Details

.defaultObject

Use www or go for the first one



37
38
39
# File 'app/models/atreides/site.rb', line 37

def default
  find_by_name('www') || first || create(:name => 'www', :lang => I18n.locale)
end

Instance Method Details

#langObject

Instance methods



46
47
48
49
# File 'app/models/atreides/site.rb', line 46

def lang
  # Symbolize to make easier to integrate w I18n
  read_attribute(:lang) ? read_attribute(:lang).to_sym : nil
end