Floyd’s Thoughts…

Because Everything is Interesting!!!

Exception Notifier in Rails 2.1

with one comment

If you have recenlty or are about to Upgrade an existing Rails application to Rails 2.1 (and why wouldn’t you), be aware that your implementation of Exception Notifier might not work due to a scope change in Rails where:

@controller.filter_parameters

Is now protected, therefore the code in Exception Notifier that called it needs to be change as follows :

1
2
   #exclude_raw_post_parameters? ? @controller.filter_parameters(parameters) : parameters
   exclude_raw_post_parameters? ? @controller.send!(:filter_parameters, parameters) : parameters

Utilizing the send method allows you to call the protected method.

Fortunately the Exception Notifier plugin on GitHut has already been updated to accommodate this fix and can be installed by :

1
	./script/plugin install git://github.com/rails/exception_notification.git

NOTE
Exception Notifier (like most plugins) comes with a suite of tests that you should run as part of your build or at the very least whenever you change something as fundamental as the Rails version your using… BTW I did neither of these things and found out the hard way :-/

Written by Floyd Price

August 20th, 2008 at 6:29 pm

One Response to 'Exception Notifier in Rails 2.1'

Subscribe to comments with RSS

  1. Thanks for this. I had a hard time figuring out exactly what was going on. I appreciate the post.

    Derek Hall

    28 Nov 09 at 8:13 pm

Leave a Reply

Get Adobe Flash playerPlugin by wpburn.com wordpress themes