github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

radiant / radiant

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 878
    • 180
  • Source
  • Commits
  • Network (180)
  • Issues (43)
  • Downloads (6)
  • Wiki (113)
  • Graphs
  • Tree: e7cc7df

click here to add a description

click here to add a homepage

  • Branches (5)
    • 0.8.2
    • cuke
    • i18n
    • master
    • ui
  • Tags (6)
    • 0.8.1
    • 0.8.0
    • 0.7.1
    • 0.7.0
    • 0.6.9
    • 0.6.8
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Radiant is a no-fluff, open source content management system designed for small teams. — Read more

  cancel

http://radiantcms.org/

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Version bump, update history. 
seancribbs (author)
Sun Feb 15 10:45:38 -0800 2009
commit  e7cc7dfb6e435bc6948e5d676c490e752394a3f0
tree    47d396860d6100811fa149003429727b0145b0b2
parent  300ffd5b535c7e3ee5981213c176396889e7c920
radiant / app / models / radiant / config.rb app/models/radiant/config.rb
100644 69 lines (63 sloc) 1.991 kb
edit raw blame history
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
module Radiant
  #
  # The Radiant::Config object emulates a hash with simple bracket methods
  # which allow you to get and set values in the configuration table:
  #
  # Radiant::Config['setting.name'] = 'value'
  # Radiant::Config['setting.name'] #=> "value"
  #
  # Currently, there is not a way to edit configuration through the admin
  # system so it must be done manually. The console script is probably the
  # easiest way to this:
  #
  # % script/console production
  # Loading production environment.
  # >> Radiant::Config['setting.name'] = 'value'
  # => "value"
  # >>
  #
  # Radiant currently uses the following settings:
  #
  # admin.title :: the title of the admin system
  # admin.subtitle :: the subtitle of the admin system
  # defaults.page.parts :: a comma separated list of default page parts
  # defaults.page.status :: a string representation of the default page status
  # dev.host :: the hostname where draft pages are viewable
  # local.timezone :: the timezone offset (using a String or integer
  # from http://api.rubyonrails.org/classes/TimeZone.html)
  # used to correct displayed times
  class Config < ActiveRecord::Base
    set_table_name "config"
 
    class << self
      def [](key)
        pair = find_by_key(key)
        pair.value unless pair.nil?
      end
 
      def []=(key, value)
        pair = find_by_key(key)
        unless pair
          pair = new
          pair.key, pair.value = key, value
          pair.save
        else
          pair.value = value
          pair.save
        end
        value
      end
 
      def to_hash
        Hash[ *find(:all).map { |pair| [pair.key, pair.value] }.flatten ]
      end
    end
    
    def value=(param)
      self[:value] = param.to_s
    end
    
    def value
      if key.ends_with? "?"
        self[:value] == "true"
      else
        self[:value]
      end
    end
  end
end
 
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server