Alias the lfs_enabled method
We currently check for `project.lfs_enabled` to display the state of lfs being enabled/disabled, but this is set to nil by default, even when lfs is enabled. Aliasing the method to #lfs_enabled? will return the correct state.
This commit is contained in:
parent
019701ce9e
commit
be493207b0
3 changed files with 8 additions and 1 deletions
|
@ -548,6 +548,8 @@ class Project < ActiveRecord::Base
|
|||
self[:lfs_enabled] && Gitlab.config.lfs.enabled
|
||||
end
|
||||
|
||||
alias_method :lfs_enabled, :lfs_enabled?
|
||||
|
||||
def auto_devops_enabled?
|
||||
if auto_devops&.enabled.nil?
|
||||
has_auto_devops_implicitly_enabled?
|
||||
|
|
5
changelogs/unreleased/lfs-project-attribute-alias.yml
Normal file
5
changelogs/unreleased/lfs-project-attribute-alias.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Resolve LFS not correctly showing enabled
|
||||
merge_request: 22501
|
||||
author:
|
||||
type: fixed
|
|
@ -335,7 +335,7 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
|
|||
|
||||
restored_project_json
|
||||
|
||||
expect(project.lfs_enabled).to be_nil
|
||||
expect(project.lfs_enabled).to be_falsey
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue