Joseph Palermo's blog
Interesting Things
If you're using ack in project for textmate, be sure to edit your .ackrc file to include any non-standard file types you're using.
A project had a dramatic speed up in their test suite by mocking out ActionMailer in tests. Something to consider if your tests cause a lot of email side effects.
field_named wasn't working for us when using Webrat to drive Selenium. Our fork with the simple fix can be found here.
Interesting Things
Giving your fake acts_as_fu model the same name as an actual model you have can lead to very obscure test failures. For those not in the know, acts_as_fu gives you the ability to test your model extensions directly by creating a fake model in your tests and mixing your extensions into it.
A few people have been using Paperclip to manage their attachments and have found it easier to integrate than Attachment_fu.
Interesting Things
Integer("008") != "008".to_i
The
to_imethod is what you want, unless you want exceptions or octal numbers.Somebody needed help constructing a
named_scopewhere they could reference the count of an associatedhas_manyassociation. There was some grumbling about using:joinsand:group(and if you do this, be sure not to callcounton the scope itself without also doing a:select => 'DISTINCT primary_key'). The winning solution was to just put a counter_cache on the association and use the denormalized column instead.
Interesting Things
Somebody was seeing mongrels hang when using an older copy of the S3 gem. It turned out the older version had the option for persistent connections defaulting to true. Setting
:persistent => falseor using a newer version that hasfalseas the default fixed their problemOne of our sites was seeing a unbalanced distribution of requests despite the fact that the load balancer was evenly distributing connections. One host typically had 2x the traffic of the others, and it would switch every few hours to be a different host. It turned out to be the Google crawler, which uses a keepalive, getting stuck on a single host and making a lot of requests. The load balancer is only able to balance TCP connections, which Google is only using a single one of. The likely solution will be haproxy or something similar in front of the hosts to better distribute traffic.
Interesting Things
Tired of refreshing your page to view changes in your CSS? Erik Hanson has a bookmarklet you can use without refreshing your page. See it on his blog.
There is a beta version of the Selenium 1.1.15 gem that includes the latest selenium-server.jar (1.0 beta-2). This fixes some problems with using Firefox 3. You can get the gem here, and you can read the details here.







