Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 226
- Log:
When running Rake tasks, the use of PATH_PREFIX in routes.rb causes
problems. The routes get parsed but unless RAILS_RELATIVE_URL_ROOT is
set in the environment, they fail because PATH_PREFIX ends up 'nil'
and you can't add 'nil' to a string. Up until now I've just set the
environment variable to an empty string (any defined value will do)
and started again, but this is pretty stupid. A far simpler approach
is to just define PATH_PREFIX to an empty string if the enviroment
variable is missing, allowing rake tasks to run without extra work.Modified environment.rb to do this in all cases, including patching
old applications that aren't used, in case they're ever used again.
- Author:
- rool
- Date:
- Wed Jun 13 18:00:17 +0100 2007
- Size:
- 2528 Bytes
1 | # Be sure to restart your webserver when you modify this file. |
2 | |
3 | # Uncomment below to force Rails into production mode |
4 | # (Use only when you can't set environment variables through your web/app server) |
5 | # ENV['RAILS_ENV'] = 'production' |
6 | |
7 | # Bootstrap the Rails environment, frameworks, and default configuration |
8 | require File.join(File.dirname(__FILE__), 'boot') |
9 | |
10 | PATH_PREFIX = ENV['RAILS_RELATIVE_URL_ROOT'] || '' |
11 | |
12 | Rails::Initializer.run do |config| |
13 | # We don't run in the document root, so images etc. must come from |
14 | # a non-root location too. Hijack the 'asset host' facility to get |
15 | # helper-based links pointing in the right place. |
16 | config.action_controller.asset_host = PATH_PREFIX |
17 | |
18 | # Skip frameworks you're not going to use |
19 | config.frameworks -= [ :action_web_service ] |
20 | |
21 | # Add additional load paths for your own custom dirs |
22 | # config.load_paths += %W( #{RAILS_ROOT}/app/services ) |
23 | |
24 | # Force all environments to use the same logger level |
25 | # (by default production uses :info, the others :debug) |
26 | config.log_level = :warn |
27 | |
28 | # Use the database for sessions instead of the file system |
29 | # (create the session table with 'rake create_sessions_table') |
30 | config.action_controller.session_store = :active_record_store |
31 | |
32 | # Enable page/fragment caching by setting a file-based store |
33 | # (remember to create the caching directory and make it readable to the application) |
34 | # config.action_controller.fragment_cache_store = :file_store, "#{RAILS_ROOT}/cache" |
35 | |
36 | # Activate observers that should always be running |
37 | # config.active_record.observers = :cacher, :garbage_collector |
38 | |
39 | # Make Active Record use UTC-base instead of local time |
40 | # config.active_record.default_timezone = :utc |
41 | |
42 | # Use Active Record's schema dumper instead of SQL when creating the test database |
43 | # (enables use of different database adapters for development and test environments) |
44 | config.active_record.schema_format = :ruby |
45 | |
46 | # See Rails::Configuration for more options |
47 | end |
48 | |
49 | # Add new inflection rules using the following format |
50 | # (all these examples are active by default): |
51 | # Inflector.inflections do |inflect| |
52 | # inflect.plural /^(ox)$/i, '\1en' |
53 | # inflect.singular /^(ox)en/i, '\1' |
54 | # inflect.irregular 'person', 'people' |
55 | # inflect.uncountable %w( fish sheep ) |
56 | # end |
57 | |
58 | # Include your application configuration below |
59 | |
60 | # Allow multiple Rails applications by giving the session cookie a |
61 | # unique prefix. |
62 | |
63 | ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:session_key] = 'rforumapp_session_id' |
64 | |
65 | require RAILS_ROOT + '/config/app.rb' |