rails/rails — Issue #3384: Rails 3.1.0, Can't use off: in a fixture file
Author: powertoaster
Created: 2011-10-21 00:20:41+00:00
State: open

I have a fixture file with the following contents:

one:
tsdate: 2011-10-19
off: false
vacation: 9.99
holiday: 9.99
comment: MyText
admin_comment: MyText
approved: false
employee_id: 1
breakfast: false
lunch: false
dinner: false
paid: false
amount: 9.99

two:
tsdate: 2011-10-19
off: false
vacation: 9.99
holiday: 9.99
comment: MyText
admin_comment: MyText
approved: false
employee_id: 1
breakfast: false
lunch: false
dinner: false
paid: false
amount: 9.99

Rails is interpreting the off: in the second column as false, so it tries to insert the value false into the field false, which does not exist.

ActiveRecord::StatementInvalid: SQLite3::SQLException: table timesheets has no column named false: INSERT INTO "timesheets" ("comment", "vacation", "false",...