public
Description: El Dorado is a full-stack community web application written in Ruby/Rails.
Homepage: http://almosteffortless.com/eldorado/
Clone URL: git://github.com/trevorturk/el-dorado.git
el-dorado / app / models / setting.rb
100644 23 lines (17 sloc) 0.681 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class Setting < ActiveRecord::Base
  
  validates_presence_of :time_zone
    
  TITLE = 'El Dorado'
  TAGLINE = 'A full-stack community web application written in Ruby/Rails'
  FOOTER = '<p style="text-align:right;margin:0;">Powered by <a href="http://almosteffortless.com/eldorado/">El Dorado</a></p>'
  LOGIN_MESSAGE = 'You are not logged in'
  TIME_ZONE = 'UTC'
  
  def theme
    read_attribute(:theme) # TODO not sure why this is needed, but tests are failing without it
  end
  
  def self.defaults
    Setting.new(:title => TITLE, :tagline => TAGLINE, :footer => FOOTER, :login_message => LOGIN_MESSAGE, :time_zone => TIME_ZONE).save
  end
  
  def to_s
    title
  end
end