Rails Tips: Make fixtures play nice with acts_as_paranoid
I was trying to write a test involving deleted items on a project using acts_as_paranoid (which marks objects with a deleted_at date instead of actually deleting them). When I created a fixture with a deleted_at date set, it turns out that making the fixture retrieval call items(:deleted_item) would fail because internally the fixtures use a find, which then fails to find the deleted item. Here’s a workaround that extends the Fixtures class to do the right thing:
acts_as_paranoid_fixtures.rb on gist.github.com










No Comments Yet