add more fake data
This commit is contained in:
1 parent
b6004958c9
commit
1c6badfb10
2 files changed
+14
-11
No files matched your search
+14
-7
@@ -1,10 +1,3 @@
|
||||
# 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 'factory_girl'
|
||||
|
||||
FactoryGirl.define do
|
||||
@@ -18,10 +11,24 @@ FactoryGirl.define do
|
||||
f.create_user_id BSON::ObjectId('4f45f3b9e9d02c5db9000067') #user_id, this is Chris' account
|
||||
f.update_user_id BSON::ObjectId('4f45f3b9e9d02c5db9000067') #user_id, this is Chris' account
|
||||
end
|
||||
|
||||
factory :custom_record, class: "WritingJournal" do |f|
|
||||
f.sequence(:paper_title_translations) {|n|{zh_tw: "tw_test #{n}", en: "en_test #{n}" }}
|
||||
f.sequence(:keywords) {|n| "keywords #{n}"}
|
||||
f.sequence(:abstract) {|n| "abstract #{n}"}
|
||||
f.sequence(:isbn) {|n| "0714312#{n}#{n}#{n}"}
|
||||
f.sequence(:year) {|n| "201#{n}"}
|
||||
f.create_user_id BSON::ObjectId('4f45f3b9e9d02c5db9000067') #user_id, this is Chris' account
|
||||
f.update_user_id BSON::ObjectId('4f45f3b9e9d02c5db9000067') #user_id, this is Chris' account
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
#product 50 records
|
||||
#
|
||||
50.times.each do
|
||||
FactoryGirl.create(:paper_record)
|
||||
end
|
||||
|
||||
FactoryGirl.create(:custom_record, journal_title_translations: {zh_tw: "tw_test A", en: "en_test A"})
|
||||
FactoryGirl.create(:custom_record, journal_title_translations: {zh_tw: "tw_test B", en: "en_test B"})
|
||||
Reference in new issue
Block a user