diff options
author | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2012-06-25 15:05:33 +0200 |
---|---|---|
committer | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2012-06-25 15:27:34 +0200 |
commit | 93570e1c59f003fc814c7f0f2252289ff9baed38 (patch) | |
tree | 3e475e28db7aa3880e19ae6b2ecc89bb7fa0e1a7 /config | |
parent | 5a0a444c2fced1554770ea6d0a9a28b958bc803f (diff) | |
download | ecs2-93570e1c59f003fc814c7f0f2252289ff9baed38.tar.gz ecs2-93570e1c59f003fc814c7f0f2252289ff9baed38.zip |
Modified ECS initialization.
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/ecs_00.rb (renamed from config/initializers/ecs_init.rb) | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/config/initializers/ecs_init.rb b/config/initializers/ecs_00.rb index e91577f..944db14 100644 --- a/config/initializers/ecs_init.rb +++ b/config/initializers/ecs_00.rb @@ -27,7 +27,6 @@ end FILTER_API=FilterApi.new # read configuration data - require 'yaml' begin @@ -38,3 +37,34 @@ end ECS_CONFIG["participants"]["allow_anonymous"] = false unless defined? ECS_CONFIG["participants"]["allow_anonymous"] +# Initialize database objects +Organization.create \ + :name => "not available", + :description => "For anonymous participants.", + :abrev => "n/a" \ + if Organization.find_by_name("not available").nil? +Organization.create \ + :name => "system", + :description => "Internal ECS community.", + :abrev => "sys" \ + if Organization.find_by_name("system").nil? +Participant.create \ + :name => "ecs", + :description => "ECS system participant", + :dns => 'n/a', + :community_selfrouting => false, + :organization_id => Organization.find_by_name("system").id \ + if Participant.find_by_name("ecs").nil? +Community.create \ + :name => "public", + :description => "For anonymous participants." \ + if Community.find_by_name("public").nil? +%w(created destroyed updated notlinked).each do |evt| + EvType.create :name => evt if EvType.find_by_name(evt).nil? +end +Ressource.create \ + :namespace => 'sys', + :ressource => 'auths', + :postroute => true, + :events => false \ + if Ressource.find_by_namespace_and_ressource("sys","auths").nil? |