At the end of config/development.rb I have: config.after_initialize do ExceptionNotifier.exception_recipients = [''support-D4qZEMI14/jqlBn2x/YWAg@public.gmane.org''] FOOBAR = ''123'' # Just for testing end Now, when I run script/console (or the web server) it seems that the after_inialize block doesn''t run: Loading development environment.>> ExceptionNotifier.exception_recipients=> nil>> FOOBAR=> NameError: uninitialized constant FOOBAR I''m on Rails 1.2.5, BTW. What am I missing? Thanks, Brian -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Okay so the constant thing seems to be a namespace issue. The following
works:
config.after_initialize do
Kernel.const_set(''FOOBAR'', ''123'')
end
>> FOOBAR
=> ''123''
However,
config.after_initialize do
ExceptionNotifier.exception_recipients =
[''support-D4qZEMI14/jqlBn2x/YWAg@public.gmane.org'']
puts "Recipients are #{ExceptionNotifier.exception_recipients}"
end
When I run script\console, I see:
Loading development environment.
Recipients are
support-D4qZEMI14/jqlBn2x/YWAg@public.gmane.org>> ExceptionNotifier.exception_recipients
=> nil
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---