Skip to content

Commit a972858

Browse files
author
root
committed
All repositories should respond to redmine_name method
1 parent 635f4a8 commit a972858

File tree

2 files changed

+30
-6
lines changed

2 files changed

+30
-6
lines changed

Diff for: app/models/concerns/gitolitable/paths.rb

-6
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@ module Gitolitable
22
module Paths
33
extend ActiveSupport::Concern
44

5-
# This is the (possibly non-unique) basename for the Gitolite repository
6-
#
7-
def redmine_name
8-
identifier.blank? ? project.identifier : identifier
9-
end
10-
115

126
# This is the repository path from Redmine point of view.
137
# It is used to build HTTP(s) urls (including GoLang url).

Diff for: lib/redmine_git_hosting/patches/repository_patch.rb

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
require_dependency 'repository'
2+
3+
module RedmineGitHosting
4+
module Patches
5+
module RepositoryPatch
6+
7+
def self.included(base)
8+
base.send(:include, InstanceMethods)
9+
base.class_eval do
10+
unloadable
11+
end
12+
end
13+
14+
module InstanceMethods
15+
16+
# This is the (possibly non-unique) basename for the Gitolite repository
17+
#
18+
def redmine_name
19+
identifier.blank? ? project.identifier : identifier
20+
end
21+
22+
end
23+
24+
end
25+
end
26+
end
27+
28+
unless Repository.included_modules.include?(RedmineGitHosting::Patches::RepositoryPatch)
29+
Repository.send(:include, RedmineGitHosting::Patches::RepositoryPatch)
30+
end

0 commit comments

Comments
 (0)