Sha256: 1827c8a5823983286e8a68ec0d0125aa770650847dd7a5e6dcb8d0e5aa2a1fa3

Contents?: true

Size: 1.04 KB

Versions: 7

Compression:

Stored size: 1.04 KB

Contents

# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
#   cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
#   Mayor.create(:name => 'Daley', :city => cities.first)

require '../../factories'

##
# CRUD
##

20.times do
  Factory(:entry)
end

##
# CRUD Extended
##

5.times do
  Factory(:category)
  Factory(:post)
end

assets_path = "#{Rails.root}/db/seeds/assets"
5.times { |i| Factory(:asset,
                     :dragonfly => File.new("#{assets_path}/00#{i}.jpg"),
                     :dragonfly_required => File.new("#{assets_path}/00#{i}.jpg"),
                     :paperclip => File.new("#{assets_path}/00#{i}.jpg")) }

##
# HasManyThrough
##

5.times do
  project = Factory(:project)
  5.times { project.collaborators << Factory(:user) }
end

##
# HasOne
##

5.times do
  Factory(:invoice)
end

##
# Polymorphic
##

5.times do
  Factory(:bird)
  Factory(:dog)
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
typus-3.1.0.rc7 test/fixtures/rails_app/db/seeds.rb
typus-3.1.0.rc6 test/fixtures/rails_app/db/seeds.rb
typus-3.1.0.rc5 test/fixtures/rails_app/db/seeds.rb
typus-3.1.0.rc4 test/fixtures/rails_app/db/seeds.rb
typus-3.1.0.rc3 test/fixtures/rails_app/db/seeds.rb
typus-3.1.0.rc2 test/fixtures/rails_app/db/seeds.rb
typus-3.1.0.rc1 test/fixtures/rails_app/db/seeds.rb