fixed empty db bug
This commit is contained in:
parent
633a68675a
commit
749e794c30
|
@ -1,6 +1,11 @@
|
|||
require 'factory_girl'
|
||||
require 'faker'
|
||||
|
||||
CoAuthorRelation.destroy_all
|
||||
CoAuthor.destroy_all
|
||||
JournalLevelType.destroy_all
|
||||
WritingJournalFile.destroy_all
|
||||
WritingJournal.destroy_all
|
||||
#Dir[Rails.root.join("spec/factories/*.rb")].each {|f| require f}
|
||||
|
||||
10.times do
|
||||
|
@ -18,3 +23,5 @@ end
|
|||
50.times do
|
||||
FactoryGirl.create(:co_author_candidate)
|
||||
end
|
||||
|
||||
puts "Success!"
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
CoAuthorRelation.destroy_all
|
||||
|
||||
types = ["friend", "teacher", "student", "schoolmate", "parent", "best friend", "instructor", "labmate", "TA", "mate"]
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
CoAuthor.destroy_all
|
||||
|
||||
name_tw = Array.new 51,""
|
||||
name_tw = name_tw.map do |p| Faker::Name::name end
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
JournalLevelType.destroy_all
|
||||
|
||||
level = ["SCI", "SCIE", "SSCI", "AH & HCI", "EI", "CSCI", "CSSCI", "TSCI", "TSSCI", "THCI"]
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
WritingJournalFile.destroy_all
|
||||
|
||||
file_desc = Array.new 7, ""
|
||||
file_desc = file_desc.map do |p| Faker::Lorem.word end
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
require 'json'
|
||||
|
||||
WritingJournal.destroy_all
|
||||
|
||||
data = File.read("#{Rails.root}/db/data")
|
||||
data_json = JSON.parse(data)
|
||||
|
|
Loading…
Reference in New Issue