I have the following and the hosts (second to last) line isn't working. Is this possible? How would I assign to it for the save?
venues = Venue.all
users = User.all
Fabricate.times(16, :event ) do
venue { venues.sample }
created_by { users.sample }
sales_rep { users.sample }
casting_rep { users.sample }
hosts << { users.sample(2) }
end
Unless hosts is already an array with default value of []
the <<
won't work.
Better might be...
hosts { [users.sample, users.sample] }