Migrating Typo and b.settings['canonical_server_url'] bug

Posted by Tim Connor Thu, 12 Oct 2006 18:14:00 GMT

While setting up a new typo install on Dreamhost I hit a bug in the migrations, specifically 051_fix_canonical_server_url. Basically, if you run rake db:migrate to get the DB ready for typo, it chokes because it expects that you have already configured typo.

b.settings['canonical_server_url'].gsub(%r{/$},'')
fails because b.settings[‘canonical_server_url’] isn’t defined, but it’s easy enough to fix, just add unless b.settings[‘canonical_server_url’].nil? to the end of that line:

b.settings['canonical_server_url'].gsub(%r{/$},'') unless b.settings['canonical_server_url'].nil?
Comment form

(leave url/email »)

Help with Textile (code)