Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

Standup 03/26/2007

Interesting Things

  • Running initialization blocks per environment
    • Set an array in environment.rb to capture your procs that will do your post-initialization: POST_LOAD_BLOCKS = []
    • Now, in your environment-specific initialization files, you can do stuff like:
    • Then, back in environment.rb, after your environment has been initialized, loop over your array:

Paydirt! These procs you’re appending to the POST_LOAD_BLOCKS array will get executed after your environment is completely initialized.

  • Use silence_warnings to (you guessed it!) ‘silence’ warnings in Ruby – only pros should use it, and only when its clear exactly what you are doing!

Ask for Help

  • None need today

Total Stand-up Meeting Time: ?

  1. Brian Takita says:

    Rails::Initializer has a method named after_initialize that takes a block. Unfortunately, it can only take one callback, so it can’t be used multiple times without special handling.

Post a Comment

Your Information (Name required. Email address will not be displayed with comment.)

* Copy This Password *

* Type Or Paste Password Here *