aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsobiemir <sobiemir@aculo.pl>2019-01-08 00:06:56 +0100
committersobiemir <sobiemir@aculo.pl>2019-01-08 00:06:56 +0100
commit570799ede176c2a6fc63ae9711c1540349db0ad7 (patch)
tree29ec05a1fa84f67ff6bf0f41bdccf08ae6e01381
parent2c2ccf0f35db39e78e98b52160ae2196599d3242 (diff)
downloadredmine-revision-redirect-570799ede176c2a6fc63ae9711c1540349db0ad7.tar.gz
redmine-revision-redirect-570799ede176c2a6fc63ae9711c1540349db0ad7.zip
Add redirect after click on repository tab
-rw-r--r--lib/revision_repositories_patch.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/revision_repositories_patch.rb b/lib/revision_repositories_patch.rb
index 1edf62e..2bce717 100644
--- a/lib/revision_repositories_patch.rb
+++ b/lib/revision_repositories_patch.rb
@@ -7,6 +7,7 @@ module RevisionRepositoriesPatch
base.class_eval do
unloadable
before_action :destroy_revision_redirects, :only => [:destroy]
+ before_action :repository_instant_redirect, :only => [:show]
end
end
end
@@ -16,4 +17,12 @@ module RevisionRepositoriesInstanceMethods
redirect = RevisionRedirect.where(repository_id: params[:id]).first
redirect.destroy if request.delete?
end
+
+ def repository_instant_redirect
+ redirect = RevisionRedirect.where(repository_id: @repository.id).first
+ if redirect != nil && redirect.repository_redirect == true then
+ redirect_to redirect.repository_link
+ end
+ false
+ end
end