I installed 'faker' gem but when I use it (Faker::Book.name) it doesn't display a random name, but only a string "Faker::Book"
lib > tasks > data_populate
require 'colorize'
namespace :data_populate do
namespace :populate do
desc "Populate all model data set"
task :all => :environment do
require 'faker'
puts "\n'Populating Model Data'".yellow
Job.where(name: "Faker::Book").destroy_all
10.times do |l|
Job.create(name: Faker::Book.name, description: Faker::Lorem.sentence(7), business_id: 1)
end
end #all end
end #populate end
end #end rake dashboard
When the code runs, the Job Title is always "Faker::Book"