-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathseeds.rb
37 lines (29 loc) · 1.64 KB
/
seeds.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Reindexer.fix_common_names("Plantae", "plants")
Reindexer.fix_common_names("Animalia", "animals")
Reindexer.fix_all_counter_culture_counts
Rank.fill_in_missing_treat_as
# forces creates:
Rails.cache.clear
License.public_domain
Language.english
u = User.create(username: "admin", email: "[email protected]", password: "admin4Tramea", role: :admin)
u.activate
user = User.create(email: "[email protected]", username: "cigarman", name: "Sigmond Freud", password: "foobarbaz")
user = User.create(email: "[email protected]", username: "sweaver", name: "Sigourney Weaver", password: "foobarbaz")
user = User.create(email: "[email protected]", username: "david", name: "David Attenboro", password: "foobarbaz")
# Required for Percona, until we get 'true' PKs:
Collection.connection.execute('SET GLOBAL pxc_strict_mode=PERMISSIVE') rescue nil
c = Collection.create(id: 1, name: "Featured Collections", description: "Items in this collection will be featured on the homepage.")
c.users << u
partner = Partner.create(name: "Encyclopedia of Life", short_name: "EOL", description: "You know it.", homepage_url: "https://eol.org", repository_id: 1)
Resource.create(name: "EOL Dynamic Hierarchy", abbr: "DWH", description: "The 'consensus' tree of life.", partner_id: partner.id, repository_id: 1)
# Really, there are a great many of these. See the Harvesting code base for a complete list...
{ accepted: true, preferred: true, valid: true, synonym: false, misnomer: false }.each do |name, pref|
TaxonomicStatus.where(name: name).first_or_create do |ts|
ts.name = name
ts.is_preferred = pref
end
end
DhDataSet.rebuild_from_tsv
TraitBank::Admin.remove_all_data_leave_terms
Page::DescInfo.refresh