Commit e3d32e8a authored by Micaël Bergeron's avatar Micaël Bergeron

fix specs

parent 2057a6ac
......@@ -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
......
......@@ -47,7 +47,7 @@ class Upload < ActiveRecord::Base
end
def local?
return true
true
end
def foreground_checksummable?
......
......@@ -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
......@@ -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
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment