aboutsummaryrefslogtreecommitdiff
path: root/db/seeds.rb
blob: 8a4c670fbb1c99ca8952f2a1df981d6587b474e1 (plain)
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
# 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 rails db:seed command (or created alongside the database with db:setup).
#
# Examples:
#
#   movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
#   Character.create(name: 'Luke', movie: movies.first)

# Create a bunch of Agents
{
  'Dewey': '6347f151-6782-437c-8bae-55730672a76f',
  'PS': '3211da93-69fb-4d9b-825c-6ab51784fd18',
  'incommon': '262ea4f5-186d-483b-8414-025f23b65eb4',
  'ConcertES': '066e5968-03c3-4c15-bd5b-f73a10b5e9f1'
}.each do |agent_name, uuid|
  Agent.find_or_create_by(name: agent_name, uuid: uuid)
end

dewey = Agent.find_by(uuid: '6347f151-6782-437c-8bae-55730672a76f') or die('Dewey Agent should be available by now!')

# Create a default taxonomy
Taxonomy.find_or_create_by(
  name: 'Dewey Maps Taxonomy',
  summary: 'Original taxonomy used in Belgique, Mode d\'Emploi',
  description: '## Dewey Maps Taxonomy',
  uuid: '2519915f-d19c-4281-b758-f5ddb889d7fa',
  agent_id: dewey.id
)