#34: refactoring of Project#git_project_address method
This commit is contained in:
parent
edb07417d8
commit
29d50b9959
|
@ -138,7 +138,7 @@ class Project < ActiveRecord::Base
|
||||||
owner == user
|
owner == user
|
||||||
end
|
end
|
||||||
|
|
||||||
def git_project_address auth_user
|
def git_project_address(auth_user = nil)
|
||||||
host ||= EventLog.current_controller.request.host_with_port rescue ::Rosa::Application.config.action_mailer.default_url_options[:host]
|
host ||= EventLog.current_controller.request.host_with_port rescue ::Rosa::Application.config.action_mailer.default_url_options[:host]
|
||||||
protocol = APP_CONFIG['mailer_https_url'] ? "https" : "http" rescue "http"
|
protocol = APP_CONFIG['mailer_https_url'] ? "https" : "http" rescue "http"
|
||||||
opts = {:host => host, :protocol => protocol}
|
opts = {:host => host, :protocol => protocol}
|
||||||
|
@ -243,7 +243,7 @@ class Project < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def html_url
|
def html_url
|
||||||
git_project_address(nil).gsub(/.git$/, '')
|
git_project_address.gsub(/.git$/, '')
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
Loading…
Reference in New Issue