aboutsummaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
authorXinhui Xu2017-11-30 11:09:36 +0100
committerGitHub2017-11-30 11:09:36 +0100
commita7930abe5a70b8b964af0dcbf86fe0a587ea98cb (patch)
treedc8e1a1ff57ff0328e4b8b2ac72932f82e379406 /db
parentfb7ad0e23e73954e6e5d172d61edb31cd686b8b4 (diff)
parent7b019504fd792293f1112b2375228505fab303fe (diff)
downloadchouette-core-a7930abe5a70b8b964af0dcbf86fe0a587ea98cb.tar.bz2
Merge branch 'master' into 4981_last_editor
Diffstat (limited to 'db')
-rw-r--r--db/seeds.rb1
-rw-r--r--db/seeds/chouette.seeds.rb6
-rw-r--r--db/seeds/stif.rb38
3 files changed, 1 insertions, 44 deletions
diff --git a/db/seeds.rb b/db/seeds.rb
new file mode 100644
index 000000000..b7db25411
--- /dev/null
+++ b/db/seeds.rb
@@ -0,0 +1 @@
+# Empty
diff --git a/db/seeds/chouette.seeds.rb b/db/seeds/chouette.seeds.rb
deleted file mode 100644
index 1cbdb584d..000000000
--- a/db/seeds/chouette.seeds.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-path = File.join(File.expand_path('../seeds', __FILE__), "*.rb")
-
-Dir.glob(path).sort.each do |file|
- puts "Seed #{file}"
- load file
-end
diff --git a/db/seeds/stif.rb b/db/seeds/stif.rb
deleted file mode 100644
index d31a35cfc..000000000
--- a/db/seeds/stif.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-# coding: utf-8
-# 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).
-
-stop_area_referential = StopAreaReferential.find_or_create_by!(name: "Reflex")
-line_referential = LineReferential.find_or_create_by!(name: "CodifLigne")
-
-# Organisations
-stif = Organisation.find_or_create_by!(code: "STIF") do |org|
- org.name = 'STIF'
-end
-operator = Organisation.find_or_create_by!(code: 'transporteur-a') do |organisation|
- organisation.name = "Transporteur A"
-end
-
-# Member
-line_referential.add_member stif, owner: true
-line_referential.add_member operator
-
-stop_area_referential.add_member stif, owner: true
-stop_area_referential.add_member operator
-
-# Users
-stif.users.find_or_create_by!(username: "admin") do |user|
- user.email = 'stif-boiv@af83.com'
- user.password = "secret"
- user.name = "STIF Administrateur"
-end
-
-operator.users.find_or_create_by!(username: "transporteur") do |user|
- user.email = 'stif-boiv+transporteur@af83.com'
- user.password = "secret"
- user.name = "Martin Lejeune"
-end
-
-# Include all Lines in organisation functional_scope
-stif.update sso_attributes: { functional_scope: line_referential.lines.pluck(:objectid) }
-operator.update sso_attributes: { functional_scope: line_referential.lines.limit(3).pluck(:objectid) }