Commit 8cb05f91 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre Committed by GitLab Release Tools Bot

Merge branch 'jc-fix-set-project-writable' into 'master'

Fix method to mark a project repository as writable

See merge request gitlab-org/gitlab-ce!25546

(cherry picked from commit a8a02387)

df044542 Fix project set_repository_writable!
parent 5995ff97
......@@ -1830,7 +1830,7 @@ class Project < ActiveRecord::Base
# Set repository as writable again
def set_repository_writable!
with_lock do
update_column(repository_read_only, false)
update_column(:repository_read_only, false)
end
end
......
---
title: Fix method to mark a project repository as writable
merge_request: 25546
author:
type: fixed
......@@ -2487,6 +2487,16 @@ describe Project do
end
end
describe '#set_repository_writable!' do
it 'sets repository_read_only to false' do
project = create(:project, :read_only)
expect { project.set_repository_writable! }
.to change(project, :repository_read_only)
.from(true).to(false)
end
end
describe '#pushes_since_gc' do
let(:project) { create(:project) }
......
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