This project is archived and is in readonly mode.

#124 ✓resolved
Rhett Sutphin

Fixture named accessors do not work when the fixture name is not the table name

Reported by Rhett Sutphin | May 6th, 2008 @ 05:05 PM

If you have a fixture name which does not match the table name for the associated model, the fixture named accessors will raise an exception like this:

NoMethodError: undefined method `[]' for nil:NilClass

The underlying cause is similar to ticket #8: @loaded_fixtures has values stored in it using the table name, but loaded using the fixture name. The attached patch (with test) fixes this.

(The test case is simpler than a real-life situation, but illustrates the problem. A real-life situation might involve prefixed/suffixed tables or tables in different schemas.)

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>

People watching this ticket