diff options
author | Micaël Bergeron <mbergeron@gitlab.com> | 2018-01-30 08:15:34 -0500 |
---|---|---|
committer | Micaël Bergeron <mbergeron@gitlab.com> | 2018-02-01 12:14:46 -0500 |
commit | e3d32e8a2689bba9497d22fa6da1d9946df67f27 (patch) | |
tree | fd988cc1458134c3a7e8dba0b8ab4ef1522bf627 | |
parent | 2057a6acdee7c1f6824ff6289b0d979e8cb15f35 (diff) | |
download | gitlab-ce-e3d32e8a2689bba9497d22fa6da1d9946df67f27.tar.gz |
fix specs
-rw-r--r-- | app/models/group.rb | 1 | ||||
-rw-r--r-- | app/models/upload.rb | 2 | ||||
-rw-r--r-- | db/migrate/20180119135717_add_uploader_index_to_uploads.rb | 4 | ||||
-rw-r--r-- | db/schema.rb | 6 | ||||
-rw-r--r-- | spec/lib/gitlab/background_migration/prepare_untracked_uploads_spec.rb | 4 |
5 files changed, 7 insertions, 10 deletions
diff --git a/app/models/group.rb b/app/models/group.rb index 415507a6aea..62b1322ebe6 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -37,7 +37,6 @@ class Group < Namespace validates :two_factor_grace_period, presence: true, numericality: { greater_than_or_equal_to: 0 } - after_create :post_create_hook after_destroy :post_destroy_hook after_save :update_two_factor_requirement diff --git a/app/models/upload.rb b/app/models/upload.rb index a9f144d2fa2..fb55fd8007b 100644 --- a/app/models/upload.rb +++ b/app/models/upload.rb @@ -47,7 +47,7 @@ class Upload < ActiveRecord::Base end def local? - return true + true end def foreground_checksummable? diff --git a/db/migrate/20180119135717_add_uploader_index_to_uploads.rb b/db/migrate/20180119135717_add_uploader_index_to_uploads.rb index a678c3d049f..7fedfaa5d7d 100644 --- a/db/migrate/20180119135717_add_uploader_index_to_uploads.rb +++ b/db/migrate/20180119135717_add_uploader_index_to_uploads.rb @@ -9,12 +9,12 @@ class AddUploaderIndexToUploads < ActiveRecord::Migration disable_ddl_transaction! def up - remove_concurrent_index :uploads, :path + remove_concurrent_index :uploads, :path if index_exists? :uploads, :path add_concurrent_index :uploads, [:uploader, :path], using: :btree end def down - remove_concurrent_index :uploads, [:uploader, :path] + remove_concurrent_index :uploads, [:uploader, :path] if index_exists? :uploads, [:uploads, :path] add_concurrent_index :uploads, :path, using: :btree end end diff --git a/db/schema.rb b/db/schema.rb index 4e82a688725..7e632fe2174 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20180115201419) do +ActiveRecord::Schema.define(version: 20180129193323) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -1751,11 +1751,13 @@ ActiveRecord::Schema.define(version: 20180115201419) do t.string "model_type" t.string "uploader", null: false t.datetime "created_at", null: false + t.string "mount_point" + t.string "secret" end add_index "uploads", ["checksum"], name: "index_uploads_on_checksum", using: :btree add_index "uploads", ["model_id", "model_type"], name: "index_uploads_on_model_id_and_model_type", using: :btree - add_index "uploads", ["path"], name: "index_uploads_on_path", using: :btree + add_index "uploads", ["uploader", "path"], name: "index_uploads_on_uploader_and_path", using: :btree create_table "user_agent_details", force: :cascade do |t| t.string "user_agent", null: false diff --git a/spec/lib/gitlab/background_migration/prepare_untracked_uploads_spec.rb b/spec/lib/gitlab/background_migration/prepare_untracked_uploads_spec.rb index 1a4b9f427d6..370c2490b97 100644 --- a/spec/lib/gitlab/background_migration/prepare_untracked_uploads_spec.rb +++ b/spec/lib/gitlab/background_migration/prepare_untracked_uploads_spec.rb @@ -132,10 +132,6 @@ describe Gitlab::BackgroundMigration::PrepareUntrackedUploads, :sidekiq do context 'when there are files in /uploads/tmp' do it_behaves_like 'does not add files in /uploads/tmp' - described_class.new.perform - - expect(untracked_files_for_uploads.count).to eq(5) - end end end end |