Friday, May 27, 2016

RoR Faker Information Not Displaying | Fixed issues

Newest questions tagged ruby-on-rails - Stack Overflow

RoR Faker Information Not Displaying | Fixed issues


RoR Faker Information Not Displaying

Posted: 27 May 2016 06:59 AM PDT

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 

No comments:

Post a Comment