Forum: Ruby on Rails Configuration Documentation

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
lists (Guest)
on 2005-12-06 00:33
(Received via mailing list)
Hi,

Where can I get the documentation/list of options for Rails
configuration?

The default environment.rb file references some default observers,
caching
options, etc... But I can't find doco.

I do see this line:

See Rails::Configuration for more options

Where would that be?

Thanks,
Hunter
dez (Guest)
on 2005-12-06 01:38
(Received via mailing list)
It's talking about the Configuration class in the Rails module, which
is defined in
/usr/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/initializer.rb
lists (Guest)
on 2005-12-06 02:02
(Received via mailing list)
Great, thanks.

One line in the default environment.rb that I was curious about:

  # Activate observers that should always be running
  # config.active_record.observers = :cacher, :garbage_collector

This line makes it sound important but it is commented out. Where can I
learn about what these are and how they function?

Thanks,
Hunter
listbox (Guest)
on 2005-12-06 18:49
(Received via mailing list)
On 6-dec-2005, at 1:01, Hunter H. wrote:

> Great, thanks.
>
> One line in the default environment.rb that I was curious about:
>
>   # Activate observers that should always be running
>   # config.active_record.observers = :cacher, :garbage_collector
>
> This line makes it sound important but it is commented out. Where
> can I
> learn about what these are and how they function?

Read on ActiveRecord::Observer for the documentation. Moreover,
CacheSweepers are also observers.

Observers are singletons that "watch" your ActiveRecords and fire
when active records are modified (basically, they are standalone
callback containers, so to speak). An observer can be asked to watch
a particular set of models, and a method on the observer is called
for every AR callback.

The configuration is there because the observer needs to be
instantiated explicitly after defining them, as in

ChangeNotifier.instance

or hooked into the controller via the
observers :change_notifier, :html_cleaner line.

Observers are super-cool, for instance if you want to send e-mails
everytime a comment is posted to something etc.



--
Julian 'Julik' Tarkhanov
me at julik.nl
This topic is locked and can not be replied to.