diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/environment.rb | 14 | ||||
-rw-r--r-- | config/general-example | 27 |
2 files changed, 37 insertions, 4 deletions
diff --git a/config/environment.rb b/config/environment.rb index 2e3fc4db2..2b3211690 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -10,6 +10,11 @@ RAILS_GEM_VERSION = '1.2.1' unless defined? RAILS_GEM_VERSION # Bootstrap the Rails environment, frameworks, and default configuration require File.join(File.dirname(__FILE__), 'boot') +# MySociety specific helper functions +$:.push("../rblib") +load "validate.rb" +load "config.rb" + Rails::Initializer.run do |config| # Settings in config/environments/* take precedence over those specified here @@ -42,6 +47,10 @@ Rails::Initializer.run do |config| config.active_record.default_timezone = :utc # See Rails::Configuration for more options + + # Load intial mySociety config + MySociety::Config.set_file(File.join(config.root_path, 'config', 'general'), true) + MySociety::Config.load_default end # Add new inflection rules using the following format @@ -62,10 +71,6 @@ ActiveRecord::Errors.default_error_messages[:blank] = "must be filled in" # Include your application configuration below -# Include our own helper functions -$:.push("../rblib") -load "validate.rb" - # Output HTML 4.0 compliant code, using method described in this ticket # http://dev.rubyonrails.org/ticket/6009 ActionView::Helpers::TagHelper.module_eval do @@ -74,3 +79,4 @@ ActionView::Helpers::TagHelper.module_eval do end end + diff --git a/config/general-example b/config/general-example new file mode 100644 index 000000000..172145343 --- /dev/null +++ b/config/general-example @@ -0,0 +1,27 @@ +<?php +/* + * general-example: + * Example values for the "general" config file. + * + * Configuration parameters, in PHP syntax. Configuration parameters are set + * using the PHP define('OPTION_...', '...') function. Both perl and PHP code + * parse this properly, so you can use comments and conditionals and whatnot, + * but unless essential it's better to keep it simple.... + * + * Copy this file to one called "general" in the same directory. Or + * have multiple config files and use a symlink to change between them. + * + * Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. + * Email: francis@mysociety.org; WWW: http://www.mysociety.org + * + * $Id: general-example,v 1.1 2007-10-24 11:39:38 francis Exp $ + * + */ + +// URL for use in emails etc. +define('OPTION_BASE_URL', 'http://127.0.0.1:3000'); + +// For test sites +define('OPTION_STAGING_SITE', 1); + +?> |