See Rails::Configuration for more options?


#1

In config/environment.rb it states:

See Rails::Configuration for more options

See where exactly? I can’t find any docs for it, not at
api.rubyonrails.com anyway.

Joe


#2

The class Rails::Configuration can be found in the svn repo in
railties/lib/initializer.rb around line 342. I’m not sure why
documentation isn’t posted, but you should be able to read the comments
in that class.

So an example of turning off colorized logging the rails 1.0 way would
be to access the ActiveRecord::Base options via ‘config.active_record’
in environment.rb. The full line would therefore be:

config.active_record.colorize_logging = false

There are lists of more classes that can be accessed in this manner in
the Configuration class code.

That’s how I understand the workings, but I haven’t seen this documented
elsewhere.

Hope that helps,

Andy


#3

Actually all the documentation for railties is missing from api, there
must be a reason but still this is sooooo frustrating sometimes.

jean


#4

Aahhh… thanks. Makes sense now. On my system, it’s in
/usr/local/lib/ruby/gems/1.8/gems/rails-0.14.2/lib/initializer.rb. Its
main options are:

  self.frameworks                   = default_frameworks
  self.load_paths                   = default_load_paths
  self.log_path                     = default_log_path
  self.log_level                    = default_log_level
  self.view_path                    = default_view_path
  self.controller_paths             = default_controller_paths
  self.cache_classes                = default_cache_classes
  self.breakpoint_server            = default_breakpoint_server
  self.whiny_nils                   = default_whiny_nils
  self.database_configuration_file  = 

default_database_configuration_file

And you’re right - the Configuration class has many other attr_accessors
for other objects like action_view, action_mailer, active_records, etc.

The Configuration class and other classes (like ActiveRecord) have their
attributes documentated in the files, but they apparently didn’t make it
to the docs at api.rubyonrails.org (I didn’t see ‘colorize_logging’
there either). Guess we’ll have to wade through the source to figure
them out until the docs hopefully include them in the future.

Joe