Sha256: 284e1fcb3d0cd7f06659ed0c35c9fde53136d4b3353c6c3ae81162e7ceb94bf3

Contents?: true

Size: 642 Bytes

Versions: 3

Compression:

Stored size: 642 Bytes

Contents

#!/usr/bin/env ruby -KU
require File.dirname(__FILE__) + '/../test/test_helper'
require File.dirname(__FILE__) + '/../test/acktive_record/test_helper'
require 'ffaker'

TIMES = (ENV['N'] || 100).to_i
POSTS     = []
DISTRICTS = []
USERS     = []

User.delete_all
Post.delete_all
District.delete_all
(Slug or Slug).delete_all

100.times do
  name = Faker::Name.name
  USERS     << (User.create!     :name => name).friendly_id
  POSTS     << (Post.create!     :name => name).friendly_id
  DISTRICTS << (District.create! :name => name).friendly_id
end

def get_id
  rand(99) + 1
end

class Array
  def rand
    self[Kernel.rand(length)]
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
friendly_id-3.0.0.beta3 extras/extras.rb
friendly_id-3.0.0.beta2 extras/extras.rb
friendly_id-3.0.0.beta1 extras/extras.rb