paulelliott/fabrication — Issue #83: attributes_for does not return the proper value for relations
Author: powertoaster
Created: 2012-01-30 23:10:57+00:00
State: open

I have a fabricator

Fabricator(:timesheet) do
ts_date { Date.today }
off false
employee
end

Timesheet has a belong_to employee relationship.

Timesheet.attributes_for(:timesheet)
Returns a hash containing ['employee' => "2"] which is the Id of the employee, which gives me an association mismatch.

It should return ['employee_id' => "2"] instead, is there some way to make this work?