X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/d446d49dd75f14f3b454fa89190068b4e475c946..b77abbed6a747e46b98b1e8478158b27ff320151:/services/api/app/controllers/database_controller.rb diff --git a/services/api/app/controllers/database_controller.rb b/services/api/app/controllers/database_controller.rb index 64818da375..dddc3400b4 100644 --- a/services/api/app/controllers/database_controller.rb +++ b/services/api/app/controllers/database_controller.rb @@ -1,3 +1,7 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + class DatabaseController < ApplicationController skip_before_filter :find_object_by_uuid skip_before_filter :render_404_if_no_object @@ -11,7 +15,7 @@ class DatabaseController < ApplicationController # we can tell they're not valuable. user_uuids = User. where('email is null or email not like ?', '%@example.com'). - collect &:uuid + collect(&:uuid) fixture_uuids = YAML::load_file(File.expand_path('../../../test/fixtures/users.yml', __FILE__)). @@ -29,6 +33,10 @@ class DatabaseController < ApplicationController fixturesets = Dir.glob(Rails.root.join('test', 'fixtures', '*.yml')). collect { |yml| yml.match(/([^\/]*)\.yml$/)[1] } + # Don't reset keep_services: clients need to discover our + # integration-testing keepstores, not test fixtures. + fixturesets -= %w[keep_services] + table_names = '"' + ActiveRecord::Base.connection.tables.join('","') + '"' attempts_left = 20 @@ -47,8 +55,8 @@ class DatabaseController < ApplicationController # create_fixtures() is a no-op for cached fixture sets, so # uncache them all. - ActiveRecord::Fixtures.reset_cache - ActiveRecord::Fixtures. + ActiveRecord::FixtureSet.reset_cache + ActiveRecord::FixtureSet. create_fixtures(Rails.root.join('test', 'fixtures'), fixturesets) # Dump cache of permissions etc. @@ -67,6 +75,10 @@ class DatabaseController < ApplicationController raise end + require 'refresh_permission_view' + + refresh_permission_view + # Done. send_json success: true end