config/initializers/dcmgr_gui.rb in wakame-vdc-webui-10.12.0 vs config/initializers/dcmgr_gui.rb in wakame-vdc-webui-11.06.0
- old
+ new
@@ -5,11 +5,16 @@
end
end
end
ActiveResource::Base.class_eval do
- #self.site = 'http://your.dcmgr.api.server/'
- self.site = 'http://localhost:9001/'
+ begin
+ @dcmgr_gui_config = YAML::load(IO.read(File.join(Rails.root, 'config', 'dcmgr_gui.yml')))[Rails.env]
+ rescue Errno::ENOENT => e
+ Rails.logger.error(e.message)
+ exit 1
+ end
+ self.site = @dcmgr_gui_config['dcmgr_site']
end
-@dcmgr_config = YAML::load(ERB.new(IO.read(File.join(Rails.root, 'config', 'database.yml'))).result)[Rails.env]
+@dcmgr_config = YAML::load(IO.read(File.join(Rails.root, 'config', 'database.yml')))[Rails.env]
Schema.connect "#{@dcmgr_config['adapter']}://#{@dcmgr_config['host']}/#{@dcmgr_config['database']}?user=#{@dcmgr_config['user']}&password=#{@dcmgr_config['password']}"