diff options
author | Douwe Maan <douwe@selenight.nl> | 2018-05-09 17:54:47 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2018-05-09 19:49:38 +0300 |
commit | f6ecb72682000f7261219bbb6ce1ca9352aa473e (patch) | |
tree | 55b4f5c9d6b1cef887ae91afb353855ba2cc18a2 /app/models/repository.rb | |
parent | 2de674483aa881461d7afc55ee0d2fd7d9685806 (diff) |
Add Repository#xcode_project? method
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r-- | app/models/repository.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index b75c4aca982..44c6bff6b66 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -37,7 +37,7 @@ class Repository changelog license_blob license_key gitignore koding_yml gitlab_ci_yml branch_names tag_names branch_count tag_count avatar exists? root_ref has_visible_content? - issue_template_names merge_request_template_names).freeze + issue_template_names merge_request_template_names xcode_project?).freeze # Methods that use cache_method but only memoize the value MEMOIZED_CACHED_METHODS = %i(license).freeze @@ -55,7 +55,8 @@ class Repository gitlab_ci: :gitlab_ci_yml, avatar: :avatar, issue_template: :issue_template_names, - merge_request_template: :merge_request_template_names + merge_request_template: :merge_request_template_names, + xcode_config: :xcode_project? }.freeze def initialize(full_path, project, disk_path: nil, is_wiki: false) @@ -594,6 +595,11 @@ class Repository end cache_method :gitlab_ci_yml + def xcode_project? + file_on_head(:xcode_config).present? + end + cache_method :xcode_project? + def head_commit @head_commit ||= commit(self.root_ref) end |