Sha256: 580e1818a8ed14ac563dcbb2d35ef11dd0a4f9b29b721d04646c042d80f42253

Contents?: true

Size: 348 Bytes

Versions: 12

Compression:

Stored size: 348 Bytes

Contents

namespace :db do
  desc "Fill database"
  task :populate => :environment do
    require 'populator'
    StaticBlocks::Snippet.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

12 entries across 12 versions & 1 rubygems

Version Path
static_blocks-1.2.1 lib/tasks/populate.rake
static_blocks-1.2.0 lib/tasks/populate.rake
static_blocks-1.1.5 lib/tasks/populate.rake
static_blocks-1.1.4 lib/tasks/populate.rake
static_blocks-1.1.3 lib/tasks/populate.rake
static_blocks-1.1.2 lib/tasks/populate.rake
static_blocks-1.1.1 lib/tasks/populate.rake
static_blocks-1.1.0 lib/tasks/populate.rake
static_blocks-1.0.3 lib/tasks/populate.rake
static_blocks-1.0.2 lib/tasks/populate.rake
static_blocks-1.0.1 lib/tasks/populate.rake
static_blocks-1.0.0 lib/tasks/populate.rake