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:
Cindy Pallares 2018-10-19 11:36:41 -05:00
parent 019701ce9e
commit be493207b0
No known key found for this signature in database
GPG key ID: 8E13768AD1946B0C
3 changed files with 8 additions and 1 deletions

View file

@ -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?

View file

@ -0,0 +1,5 @@
---
title: Resolve LFS not correctly showing enabled
merge_request: 22501
author:
type: fixed

View file

@ -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