Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
eb50944f
Commit
eb50944f
authored
Nov 27, 2018
by
Toon Claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove after_create hook
And place #track_project_repository in Projects::CreateService instead.
parent
701b4d70
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
2 deletions
+3
-2
app/models/project.rb
app/models/project.rb
+0
-2
app/services/projects/create_service.rb
app/services/projects/create_service.rb
+2
-0
spec/models/project_repository_spec.rb
spec/models/project_repository_spec.rb
+1
-0
No files found.
app/models/project.rb
View file @
eb50944f
...
...
@@ -120,8 +120,6 @@ class Project < ActiveRecord::Base
after_create
:ensure_storage_path_exists
after_save
:ensure_storage_path_exists
,
if: :namespace_id_changed?
after_create
:track_project_repository
acts_as_ordered_taggable
attr_accessor
:old_path_with_namespace
...
...
app/services/projects/create_service.rb
View file @
eb50944f
...
...
@@ -88,6 +88,8 @@ module Projects
@project
.
create_wiki
unless
skip_wiki?
end
@project
.
track_project_repository
event_service
.
create_project
(
@project
,
current_user
)
system_hook_service
.
execute_hooks_for
(
@project
,
:create
)
...
...
spec/models/project_repository_spec.rb
View file @
eb50944f
...
...
@@ -11,6 +11,7 @@ describe ProjectRepository do
describe
'.find_project'
do
it
'finds project by disk path'
do
project
=
create
(
:project
)
project
.
track_project_repository
expect
(
described_class
.
find_project
(
project
.
disk_path
)).
to
eq
(
project
)
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment