views:

151

answers:

2

I have the ff. ActiveRecord which I use only for the ID it generates:

class SomeTable < ActiveRecord::Base
end

I thought that one could specify fixtures for it through:

one:

two:

Which I refer to in other fixtures as:

other_one:
  some_field: some value
  some_table: one

But when I run my tests, I get:

Fixture::FormatError: Bad data for SomeTable fixture named one (nil)

Does anybody know how to specify empty or nil fixtures then? If this is not possible, either a work-around or an alternative solution is acceptable.

+1  A: 

Workaround:

one:
  id: 1

two:
  id: 2

...
Chry Cheng