Friday, December 19, 2008

Hoptoad Notifier environment filter

Hoptoad is a great tool for collecting error information from your rails app, however, don't forget to filter any environment variables or parameters that contain sensitive information. This is done by adding the following lines to the config/initializers/hoptoad.rb:

config.params_filters << 'my_sensitive_param'
config.environment_filters << 'my_sensitive_env'

Replace the merged values accordingly.

Also take note that as of 11/25 proxy support has been added to the HoptoadNotifier thanks to xmlblog.

Thursday, December 11, 2008

Rails multi-param attribute processing for dates

If you're manually handling date parameters built using rails date select helper be careful with since invalid dates (02/31/2008) will raise an exception. Others have blogged about this but I haven't come across a post mentioning how to deal with invalid dates the rails way just yet.

If you let rails do the work, it will try to convert the invalid date to a valid date for you. Using that code as inspiration, you can do the following:
@birthdate = Time.local(params['birthdate(1i)'].to_i, params['birthdate(2i)'].to_i, params['birthdate(3i)'].to_i).to_date

Thursday, December 04, 2008

CouchDB Peepcode

I just downloaded the CouchDB PeepCode and was following the CouchDB installation instructions when I ran into a problem. At the time the screencast was published the erlang macport install supposedly worked, however I ran into a Bus error that has apparently been out there for sometime. Fortunately, there is a simple work around until the fix is released sometime this month (hopefully).