From 8a9bc24ef87739580c19ee8455bd8224d3c18b3e Mon Sep 17 00:00:00 2001 From: Pawel Chojnacki Date: Tue, 28 Feb 2017 11:12:11 +0100 Subject: [PATCH] align schema.rb with upstream and fix rubocop warning about not freezing mutable constants and empty error classes --- db/schema.rb | 5 +++-- lib/gitlab/auth/unique_ips_limiter.rb | 2 +- lib/gitlab/request_context.rb | 3 +-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index be54b177fa6..3898eed81bd 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -111,10 +111,11 @@ ActiveRecord::Schema.define(version: 20170305203726) do t.boolean "plantuml_enabled" t.integer "max_pages_size", default: 100, null: false t.integer "terminal_max_session_time", default: 0, null: false - t.string "default_artifacts_expire_in", default: "0", null: false +(??) t.string "default_artifacts_expire_in", default: '0', null: false t.integer "unique_ips_limit_per_user", default: 10, null: false t.integer "unique_ips_limit_time_window", default: 3600, null: false t.boolean "unique_ips_limit_enabled", default: false, null: false + t.string "default_artifacts_expire_in", default: "0", null: false end create_table "audit_events", force: :cascade do |t| @@ -255,8 +256,8 @@ ActiveRecord::Schema.define(version: 20170305203726) do t.integer "lock_version" end + add_index "ci_commits", ["gl_project_id", "ref", "status"], name: "index_ci_commits_on_gl_project_id_and_ref_and_status", using: :btree add_index "ci_commits", ["gl_project_id", "sha"], name: "index_ci_commits_on_gl_project_id_and_sha", using: :btree - add_index "ci_commits", ["gl_project_id", "status"], name: "index_ci_commits_on_gl_project_id_and_status", using: :btree add_index "ci_commits", ["gl_project_id"], name: "index_ci_commits_on_gl_project_id", using: :btree add_index "ci_commits", ["status"], name: "index_ci_commits_on_status", using: :btree add_index "ci_commits", ["user_id"], name: "index_ci_commits_on_user_id", using: :btree diff --git a/lib/gitlab/auth/unique_ips_limiter.rb b/lib/gitlab/auth/unique_ips_limiter.rb index 7b1aa736769..4d401eb1b5d 100644 --- a/lib/gitlab/auth/unique_ips_limiter.rb +++ b/lib/gitlab/auth/unique_ips_limiter.rb @@ -1,7 +1,7 @@ module Gitlab module Auth class UniqueIpsLimiter - USER_UNIQUE_IPS_PREFIX = 'user_unique_ips' + USER_UNIQUE_IPS_PREFIX = 'user_unique_ips'.freeze class << self def limit_user_id!(user_id) diff --git a/lib/gitlab/request_context.rb b/lib/gitlab/request_context.rb index 548adf4775a..1dce18d1733 100644 --- a/lib/gitlab/request_context.rb +++ b/lib/gitlab/request_context.rb @@ -1,6 +1,5 @@ module Gitlab - class RequestStoreNotActive < StandardError - end + RequestStoreNotActive = Class.new(StandardError) class RequestContext class << self