Sha256: fcc9f656c375e5af69c371bf285aa4c8eb67330664c9c01b98f47b73d936de4c

Contents?: true

Size: 352 Bytes

Versions: 7

Compression:

Stored size: 352 Bytes

Contents

namespace :db do
  desc "Fill database"
  task :populate => :environment do
    require 'populator'
    StaticBlocks::StaticBlock.populate 20 do |sb|
      sb.title = Populator.words(1..3).titleize
      sb.content = Populator.sentences(1..10)
      sb.status = ['draft', 'published']
      sb.created_at = 2.years.from_now..Time.now
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
static_blocks-0.1.1 lib/tasks/populate.rake
static_blocks-0.1.0 lib/tasks/populate.rake
static_blocks-0.0.5 lib/tasks/populate.rake
static_blocks-0.0.4 lib/tasks/populate.rake
static_blocks-0.0.3 lib/tasks/populate.rake
static_blocks-0.0.2 lib/tasks/populate.rake
static_blocks-0.0.1 lib/tasks/populate.rake