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
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 On 5 Dec 2005, at 10:32pm, Hunter Hillegas wrote:> See Rails::Configuration for more options
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> From: Derek Chesterfield <dez-ee4meeAH724@public.gmane.org> > Reply-To: <rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org> > Date: Mon, 5 Dec 2005 23:37:56 +0000 > To: <rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org> > Subject: Re: [Rails] Configuration Documentation > > 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 > > On 5 Dec 2005, at 10:32pm, Hunter Hillegas wrote: > >> See Rails::Configuration for more options > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
On 6-dec-2005, at 1:01, Hunter Hillegas 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