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
dce706bf
Commit
dce706bf
authored
Mar 24, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not require a manifest for container repository
Container repository can be empty - no tags or blogs is OK.
parent
d6f37a34
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
app/models/container_repository.rb
app/models/container_repository.rb
+10
-1
No files found.
app/models/container_repository.rb
View file @
dce706bf
class
ContainerRepository
<
ActiveRecord
::
Base
class
ContainerRepository
<
ActiveRecord
::
Base
belongs_to
:project
belongs_to
:project
validates
:manifest
,
presence:
true
validates
:name
,
length:
{
minimum:
0
,
allow_nil:
false
}
validates
:name
,
length:
{
minimum:
0
,
allow_nil:
false
}
delegate
:client
,
to: :registry
delegate
:client
,
to: :registry
...
@@ -43,6 +42,8 @@ class ContainerRepository < ActiveRecord::Base
...
@@ -43,6 +42,8 @@ class ContainerRepository < ActiveRecord::Base
ContainerRegistry
::
Blob
.
new
(
self
,
config
)
ContainerRegistry
::
Blob
.
new
(
self
,
config
)
end
end
# TODO, add bang to this method
#
def
delete_tags
def
delete_tags
return
unless
tags
return
unless
tags
...
@@ -52,6 +53,14 @@ class ContainerRepository < ActiveRecord::Base
...
@@ -52,6 +53,14 @@ class ContainerRepository < ActiveRecord::Base
end
end
end
end
# TODO, specs needed
#
def
empty?
tags
.
none?
end
# TODO, we will return a new ContainerRepository object here
#
def
self
.
project_from_path
(
repository_path
)
def
self
.
project_from_path
(
repository_path
)
return
unless
repository_path
.
include?
(
'/'
)
return
unless
repository_path
.
include?
(
'/'
)
...
...
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