rom-rb / rom-factory

Data generator with support for persistence backends
MIT License
83 stars 42 forks source link

Has many association does not seem to work as expected #27

Open alexandru-calinoiu opened 6 years ago

alexandru-calinoiu commented 6 years ago

Here is what I am trying to build:

        Factory[:shift,
                shift_positions: [
                  Factory[:shift_position],
                  Factory[:shift_position]
                ]
        ]

My factory definitions are:

Factory.define :shift do |f|
  f.association(:shift_positions, count: 2)
end
Factory.define :shift_position do |f|
  f.association(:shift)
end

The problem is the top code will return the shift_positions code empty.