X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/38fcd08dda022d0167840fbb65222fe99b75fcf5..3ef580c47029ff0fbf959b044f29c183f41cb609:/services/api/app/controllers/application_controller.rb diff --git a/services/api/app/controllers/application_controller.rb b/services/api/app/controllers/application_controller.rb index 71fb365fc6..831bcceee7 100644 --- a/services/api/app/controllers/application_controller.rb +++ b/services/api/app/controllers/application_controller.rb @@ -18,8 +18,8 @@ end require 'load_param' class ApplicationController < ActionController::Base - include CurrentApiClient include ThemesForRails::ActionController + include CurrentApiClient include LoadParam include DbCurrentTime @@ -47,7 +47,7 @@ class ApplicationController < ActionController::Base before_filter(:render_404_if_no_object, except: [:index, :create] + ERROR_ACTIONS) - theme :select_theme + theme Rails.configuration.arvados_theme attr_writer :resource_attrs @@ -83,7 +83,9 @@ class ApplicationController < ActionController::Base end def index - @objects.uniq!(&:id) if @select.nil? or @select.include? "id" + if @select.nil? || @select.include?("id") + @objects = @objects.uniq(&:id) + end if params[:eager] and params[:eager] != '0' and params[:eager] != 0 and params[:eager] != '' @objects.each(&:eager_load_associations) end @@ -488,7 +490,7 @@ class ApplicationController < ActionController::Base def remote_ip # Caveat: this is highly dependent on the proxy setup. YMMV. - if request.headers.has_key?('HTTP_X_REAL_IP') then + if request.headers.key?('HTTP_X_REAL_IP') then # We're behind a reverse proxy @remote_ip = request.headers['HTTP_X_REAL_IP'] else @@ -562,8 +564,4 @@ class ApplicationController < ActionController::Base end super(*opts) end - - def select_theme - return Rails.configuration.arvados_theme - end end