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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
71103985
Commit
71103985
authored
Jun 07, 2017
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-order some methods in Project
This ensures the order of these methods is identical in CE and EE.
parent
acdd1bf7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
app/models/project.rb
app/models/project.rb
+16
-15
No files found.
app/models/project.rb
View file @
71103985
...
@@ -63,16 +63,6 @@ class Project < ActiveRecord::Base
...
@@ -63,16 +63,6 @@ class Project < ActiveRecord::Base
# update visibility_level of forks
# update visibility_level of forks
after_update
:update_forks_visibility_level
after_update
:update_forks_visibility_level
def
update_forks_visibility_level
return
unless
visibility_level
<
visibility_level_was
forks
.
each
do
|
forked_project
|
if
forked_project
.
visibility_level
>
visibility_level
forked_project
.
visibility_level
=
visibility_level
forked_project
.
save!
end
end
end
after_validation
:check_pending_delete
after_validation
:check_pending_delete
...
@@ -165,7 +155,7 @@ class Project < ActiveRecord::Base
...
@@ -165,7 +155,7 @@ class Project < ActiveRecord::Base
has_many
:todos
,
dependent: :destroy
has_many
:todos
,
dependent: :destroy
has_many
:notification_settings
,
dependent: :destroy
,
as: :source
has_many
:notification_settings
,
dependent: :destroy
,
as: :source
has_one
:import_data
,
dependent: :delete
,
class_name:
"ProjectImportData"
has_one
:import_data
,
dependent: :delete
,
class_name:
'ProjectImportData'
has_one
:project_feature
,
dependent: :destroy
has_one
:project_feature
,
dependent: :destroy
has_one
:statistics
,
class_name:
'ProjectStatistics'
,
dependent: :delete
has_one
:statistics
,
class_name:
'ProjectStatistics'
,
dependent: :delete
has_many
:container_repositories
,
dependent: :destroy
has_many
:container_repositories
,
dependent: :destroy
...
@@ -1060,6 +1050,17 @@ class Project < ActiveRecord::Base
...
@@ -1060,6 +1050,17 @@ class Project < ActiveRecord::Base
!!
repository
.
exists?
!!
repository
.
exists?
end
end
def
update_forks_visibility_level
return
unless
visibility_level
<
visibility_level_was
forks
.
each
do
|
forked_project
|
if
forked_project
.
visibility_level
>
visibility_level
forked_project
.
visibility_level
=
visibility_level
forked_project
.
save!
end
end
end
def
create_wiki
def
create_wiki
ProjectWiki
.
new
(
self
,
self
.
owner
).
wiki
ProjectWiki
.
new
(
self
,
self
.
owner
).
wiki
true
true
...
@@ -1068,6 +1069,10 @@ class Project < ActiveRecord::Base
...
@@ -1068,6 +1069,10 @@ class Project < ActiveRecord::Base
false
false
end
end
def
wiki
@wiki
||=
ProjectWiki
.
new
(
self
,
self
.
owner
)
end
def
jira_tracker_active?
def
jira_tracker_active?
jira_tracker?
&&
jira_service
.
active
jira_tracker?
&&
jira_service
.
active
end
end
...
@@ -1190,10 +1195,6 @@ class Project < ActiveRecord::Base
...
@@ -1190,10 +1195,6 @@ class Project < ActiveRecord::Base
end
end
end
end
def
wiki
@wiki
||=
ProjectWiki
.
new
(
self
,
self
.
owner
)
end
def
running_or_pending_build_count
(
force:
false
)
def
running_or_pending_build_count
(
force:
false
)
Rails
.
cache
.
fetch
([
'projects'
,
id
,
'running_or_pending_build_count'
],
force:
force
)
do
Rails
.
cache
.
fetch
([
'projects'
,
id
,
'running_or_pending_build_count'
],
force:
force
)
do
builds
.
running_or_pending
.
count
(
:all
)
builds
.
running_or_pending
.
count
(
:all
)
...
...
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