Take the 2008 Git User's Survey and help out! [ hide ]

public
Fork of trevorturk/el-dorado
Description: Localized version of El Dorado using Gibberish. Dutch language included.
Homepage: http://almosteffortless.com/eldorado/
Clone URL: git://github.com/jxl/el-dorado.git
Search Repo:
jxl (author)
Sun May 04 04:55:30 -0700 2008
commit  f38ed782aeb5ab49a83bf6538231c06ad74b8cab
tree    c50704228ea5111607c22dfd175ba99536649d26
parent  77a5fd6c4d494cc3ee2fe84f1ba1e4684a710ab7
el-dorado / app / models / setting.rb
100644 41 lines (33 sloc) 1.222 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# == Schema Information
# Schema version: 76
#
# Table name: settings
#
# id :integer(11) not null, primary key
# title :string(255)
# tagline :string(255)
# announcement :text
# footer :text
# theme :string(255)
# favicon :string(255)
# time_zone :string(255) default("UTC")
# private :boolean(1)
#
 
class Setting < ActiveRecord::Base
  
  validates_presence_of :time_zone
 
  localized_names 'Settings'[:settings],
    :time_zone => 'Default Timezone'[:default_timezone]
 
  composed_of :tz, :class_name => 'TZInfo::Timezone', :mapping => %w( time_zone 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> | <a href="http://almosteffortless.com">&aelig;</a></p>'
  
  def theme
    read_attribute(:theme) # not sure why this is needed, but tests are failing without it
  end
  
  def self.defaults
    Setting.new(:title => TITLE, :tagline => TAGLINE, :footer => FOOTER).save
  end
  
  def to_s
    title
  end
end