diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/1_settings.rb | 8 | ||||
-rw-r--r-- | config/initializers/5_backend.rb | 6 | ||||
-rw-r--r-- | config/initializers/rspec_profiling.rb | 14 | ||||
-rw-r--r-- | config/routes/project.rb | 2 | ||||
-rw-r--r-- | config/routes/snippets.rb | 1 |
5 files changed, 18 insertions, 13 deletions
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 906ec11f012..4f33aad8693 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -419,10 +419,4 @@ if Rails.env.test? end # Force a refresh of application settings at startup -begin - ApplicationSetting.expire - Ci::ApplicationSetting.expire -rescue - # Gracefully handle when Redis is not available. For example, - # omnibus may fail here during assets:precompile. -end +ApplicationSetting.expire diff --git a/config/initializers/5_backend.rb b/config/initializers/5_backend.rb index ed88c8ee1b8..2bd159ca7f1 100644 --- a/config/initializers/5_backend.rb +++ b/config/initializers/5_backend.rb @@ -1,9 +1,3 @@ -# GIT over SSH -require_dependency Rails.root.join('lib/gitlab/backend/shell') - -# GitLab shell adapter -require_dependency Rails.root.join('lib/gitlab/backend/shell_adapter') - required_version = Gitlab::VersionInfo.parse(Gitlab::Shell.version_required) current_version = Gitlab::VersionInfo.parse(Gitlab::Shell.new.version) diff --git a/config/initializers/rspec_profiling.rb b/config/initializers/rspec_profiling.rb new file mode 100644 index 00000000000..f462e654b2c --- /dev/null +++ b/config/initializers/rspec_profiling.rb @@ -0,0 +1,14 @@ +module RspecProfilingConnection + def establish_connection + ::RspecProfiling::Collectors::PSQL::Result.establish_connection(ENV['RSPEC_PROFILING_POSTGRES_URL']) + end +end + +if Rails.env.test? + RspecProfiling.configure do |config| + if ENV['RSPEC_PROFILING_POSTGRES_URL'] + RspecProfiling::Collectors::PSQL.prepend(RspecProfilingConnection) + config.collector = RspecProfiling::Collectors::PSQL + end + end +end diff --git a/config/routes/project.rb b/config/routes/project.rb index 6620b765e02..efe2fbc521d 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -64,6 +64,7 @@ constraints(ProjectUrlConstrainer.new) do resources :snippets, concerns: :awardable, constraints: { id: /\d+/ } do member do get 'raw' + post :mark_as_spam end end @@ -220,6 +221,7 @@ constraints(ProjectUrlConstrainer.new) do end member do + post :promote post :toggle_subscription delete :remove_priority end diff --git a/config/routes/snippets.rb b/config/routes/snippets.rb index 3ca096f31ba..ce0d1314292 100644 --- a/config/routes/snippets.rb +++ b/config/routes/snippets.rb @@ -2,6 +2,7 @@ resources :snippets, concerns: :awardable do member do get 'raw' get 'download' + post :mark_as_spam end end |