Closed adenta closed 3 months ago
let me do some more digging on my own. Think it has something to do with seeding
Indeed, the following code works:
def name_prefix
Faker::Config.random = Random.new(id.to_i)
[Faker::Verb.ing_form, Faker::Creature::Animal.name].join('_').gsub(/\s+/, '_').downcase
end
gotta wrap the seed in the random method, which isn't incredibly obvious but an easy fix
Describe the bug
When trying to run faker in a model (giving a song a random name) I am encountering the issue:
NoMethodError (private method
rand' called for 0:Integer):`To Reproduce
Expected behavior
This should work, but it doesn't