I am currently trying to populate a development database on a project with a bunch of fake data, to simulate how it will look and operate with hundreds of articles / users. I lo
To associate a random image in your task, you could try the following:
user.avatar = File.open(Dir.glob(File.join(Rails.root, 'sampleimages', '*')).sample)
where sampleimages is a directory containing avatars to be associated at random