[ARVADOS] created: 59f750a109a706d29862530dc3d282db75736d38
git at public.curoverse.com
git at public.curoverse.com
Fri Nov 14 14:33:58 EST 2014
at 59f750a109a706d29862530dc3d282db75736d38 (commit)
commit 59f750a109a706d29862530dc3d282db75736d38
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Fri Nov 14 14:33:55 2014 -0500
4535: Add default_url_options to application controller that consults
Rails.configuration. Added entry with documentation to
application.yml.default.
diff --git a/services/api/app/controllers/application_controller.rb b/services/api/app/controllers/application_controller.rb
index 381c5c9..762bbd9 100644
--- a/services/api/app/controllers/application_controller.rb
+++ b/services/api/app/controllers/application_controller.rb
@@ -56,6 +56,14 @@ class ApplicationController < ActionController::Base
:with => :render_not_found)
end
+ def default_url_options
+ if Rails.configuration.host
+ {:host => Rails.configuration.host}
+ else
+ {}
+ end
+ end
+
def index
@objects.uniq!(&:id) if @select.nil? or @select.include? "id"
if params[:eager] and params[:eager] != '0' and params[:eager] != 0 and params[:eager] != ''
diff --git a/services/api/config/application.default.yml b/services/api/config/application.default.yml
index be1f157..d11007c 100644
--- a/services/api/config/application.default.yml
+++ b/services/api/config/application.default.yml
@@ -50,6 +50,11 @@ test:
common:
uuid_prefix: <%= Digest::MD5.hexdigest(`hostname`).to_i(16).to_s(36)[0..4] %>
+ # If set, this is the hostname that will be used for root_url and advertised
+ # in the discovery document. By default, uses the default Rails logic for
+ # deciding on a hostname.
+ host: ~
+
# If this is not false, HTML requests at the API server's root URL
# are redirected to this location, and it is provided in the text of
# user activation notification email messages to remind them where
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list