Skip to content

Commit ebb0859

Browse files
author
root
committed
Patch for Rails4 (validate_parent_id is in the User model now)
1 parent f38a660 commit ebb0859

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

+10-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module InstanceMethods
2828
def create_with_git_hosting(&block)
2929
create_without_git_hosting(&block)
3030
# Only create repo if project creation worked
31-
create_project_repository if validate_parent_id && @project.save
31+
create_project_repository if valid_project?
3232
end
3333

3434

@@ -80,6 +80,15 @@ def reopen_with_git_hosting(&block)
8080
private
8181

8282

83+
def valid_project?
84+
if Rails::VERSION::MAJOR == 3
85+
validate_parent_id && @project.save
86+
else
87+
@project.save
88+
end
89+
end
90+
91+
8392
# Call UseCase object that will complete Project repository creation :
8493
# it will create the Repository::Xitolite association, the GitExtra association and then
8594
# the repository in Gitolite.

0 commit comments

Comments
 (0)