---
title: This week in open source
teaser:
tags: news,open source
author: Gabe Berke-Williams
published_on: 2012-04-20
---

## factory_bot[^1]

There's a new version of [factory_bot](https://github.com/thoughtbot/factory_bot) this week, as usual: 3.1.1 ([aa81d2f](http://github.com/thoughtbot/factory_bot/commit/aa81d2f96f4c4c823dc5363c64fe027a6c0209d0 "Bump version to 3.1.1")).

Mark Rushakoff ([mark-rushakoff](http://github.com/mark-rushakoff)) fixed a typo ([4682ab0](http://github.com/thoughtbot/factory_bot/commit/4682ab0701dc10c94f22e1d6ca5c18f8470999b1 "fix typo in GETTING_STARTED")).
Have I mentioned how much I love documentation fixes? Because I do.

Joshua Clayton ([joshuaclayton](http://github.com/joshuaclayton)) ensured that `FactoryBot.attributes_for` works with `has_many` associations ([50be545](http://github.com/thoughtbot/factory_bot/commit/50be54564dcb8bd801fa637b852587a947170cfe "Test has_many with attributes_for")).
He also refactored Strategies to be modules instead of classes, and added an Evaluation [fa&ccedil;ade](http://en.wikipedia.org/wiki/Facade_pattern) to make building strategies easier ([89d5e94](http://github.com/thoughtbot/factory_bot/commit/89d5e944d5aeeb29ff5feb34a94c5dccd0d0c796 "Refactor Strategies

This changes Strategy from a class to a module and removes inheritance.
It introduces an Evaluation facade to make building strategies easier")).

## flutie

[flutie](https://github.com/thoughtbot/flutie) got some love this
week from Edwin Morris ([ehmorris](http://github.com/ehmorris)),
who changed values from pixels to ems ([fd26ed0](http://github.com/thoughtbot/flutie/commit/fd26ed0406f74e8468c1ebacbc2ffa48f21679dc "Merge pull request #35 from ehmorris/master

Changed flutie pixel values to ems")) and these new-fangled CSS3 "rems". REMs
are relative to the base element's size, not to the parent's size
(more [here](http://snook.ca/archives/html_and_css/font-size-with-rem)).
I wish I'd had that back in the day.

## paperclip

[paperclip](https://github.com/thoughtbot/paperclip) got a bunch of bug fixes from Prem Sichanugrist ([sikachu](http://github.com/sikachu)).

He fixed the content_type validator to allow blanks and nils ([5eed1dc](http://github.com/thoughtbot/paperclip/commit/5eed1dcb785e8b42ea7881b1bd822394df6aa3a0 "Fix content_type validator to support blank/nil

ContentTypeValidator now honors the `:allow_nil` and `:allow_blank` option.")), ensured that code dealt with the content type, not the MimeType ([3f1d30f](http://github.com/thoughtbot/paperclip/commit/3f1d30fb61245b54227f1f997f93df963e89ddef "Call #content_type on MimeType object

This will ensure that the content type is a String.

Fixes #805")), closed ALL the files ([4f6d482](http://github.com/thoughtbot/paperclip/commit/4f6d482d9823bdf14be5ef70248531fe1e3dc363 "Close ALL the files

Make sure that we close opened files after we")), and removed unused code (yay!) ([02eb725](http://github.com/thoughtbot/paperclip/commit/02eb72593c0cc508d973af15eb455199ea8b05d0 "Remove unused code

AttachmentAdapter now handles this for us.")).

Sebastien Guignot ([sguignot](http://github.com/sguignot)) fixed `attachment.reprocess!` when using Fog or S3
([9d1355b](http://github.com/thoughtbot/paperclip/commit/9d1355b5ea8a0fbc999f52ebe477444a789bfbfc "Fix attachment.reprocess! when using storage providers fog and s3.")).

Kir Maximov ([kir](http://github.com/kir)) fixed a problem with an incorrect content_type
([3e98fc2](http://github.com/thoughtbot/paperclip/commit/3e98fc2ea7dd122176b680e5ab5b1100db97af25 "Fix a problem with incorrect content_type detected with ")).

## shoulda-matchers

[shoulda-matchers](https://github.com/thoughtbot/shoulda-matchers) continues to improve.
Gabe Berke-Williams ([gabebw](http://github.com/gabebw) - that's me!)
added tests for Rails 3.2 ([aff2824](http://github.com/thoughtbot/shoulda-matchers/commit/aff28245e798ac07fe96a89f84efbfcc1ba5b4d3 "Test against Rails 3.2."))
and bumped rspec-rails ([5baa056](http://github.com/thoughtbot/shoulda-matchers/commit/5baa056f352356ef5cc4b782bcf1d22246f08422 "Bump rspec-rails.")). As ever,
the [NEWS file](https://github.com/thoughtbot/shoulda-matchers/blob/master/NEWS.md) is the place to watch for updates to functionality.

Aaron Gibralter ([agibralter](http://github.com/agibralter)) fixed
the `ensure_length_of` matcher to check for all possible I18n error
messages ([0a8e652](http://github.com/thoughtbot/shoulda-matchers/commit/0a8e6522cf73f3781fb642bbd996eb3ceef1de7d "Use all possible i18n error messages for ensure_length_of_matcher.")),
meaning our internationalized users aren't left with false negatives in their
tests.

Victor Pereira ([vpereira](http://github.com/vpereira)) added the
`in_array` method ([e40e2cb](http://github.com/thoughtbot/shoulda-matchers/commit/e40e2cb1acf33c8716db9fecf37131aa625282bf "looks like its working"))
to the `ensure_inclusion_of` matcher, meaning you can do
`it { should ensure_inclusion_of(:attribute).in_array(%w[cat dog])` now.

[^1]: Looking for FactoryGirl? The library was renamed in 2017.
[Project name history can be found here.](https://github.com/thoughtbot/factory_bot/blob/master/NAME.md)
