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
01e551fe
Commit
01e551fe
authored
Jan 20, 2017
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove size limit convertion concern
parent
18c3f93b
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
0 additions
and
107 deletions
+0
-107
app/models/application_setting.rb
app/models/application_setting.rb
+0
-1
app/models/concerns/repository_size_limit.rb
app/models/concerns/repository_size_limit.rb
+0
-13
app/models/group.rb
app/models/group.rb
+0
-1
app/models/project.rb
app/models/project.rb
+0
-1
spec/models/concerns/repository_size_limit_spec.rb
spec/models/concerns/repository_size_limit_spec.rb
+0
-91
No files found.
app/models/application_setting.rb
View file @
01e551fe
...
...
@@ -2,7 +2,6 @@ class ApplicationSetting < ActiveRecord::Base
include
CacheMarkdownField
include
TokenAuthenticatable
prepend
EE
::
ApplicationSetting
include
RepositorySizeLimit
add_authentication_token_field
:runners_registration_token
add_authentication_token_field
:health_check_access_token
...
...
app/models/concerns/repository_size_limit.rb
deleted
100644 → 0
View file @
18c3f93b
module
RepositorySizeLimit
extend
ActiveSupport
::
Concern
included
do
before_save
:convert_from_megabytes_to_bytes
,
if: :repository_size_limit_changed?
end
private
def
convert_from_megabytes_to_bytes
self
.
repository_size_limit
=
(
repository_size_limit
*
1
.
megabyte
)
if
repository_size_limit
.
present?
end
end
app/models/group.rb
View file @
01e551fe
...
...
@@ -9,7 +9,6 @@ class Group < Namespace
include
AccessRequestable
include
Referable
include
SelectForProjectAuthorization
include
RepositorySizeLimit
prepend
EE
::
GeoAwareAvatar
has_many
:group_members
,
->
{
where
(
requested_at:
nil
)
},
dependent: :destroy
,
as: :source
...
...
app/models/project.rb
View file @
01e551fe
...
...
@@ -17,7 +17,6 @@ class Project < ActiveRecord::Base
include
ProjectFeaturesCompatibility
include
SelectForProjectAuthorization
include
Routable
include
RepositorySizeLimit
prepend
EE
::
GeoAwareAvatar
prepend
EE
::
Project
...
...
spec/models/concerns/repository_size_limit_spec.rb
deleted
100644 → 0
View file @
18c3f93b
require
'spec_helper'
describe
RepositorySizeLimit
do
context
Project
do
context
'callback'
do
describe
'#convert_from_megabyte_to_byte'
do
let
(
:project
)
{
build
(
:empty_project
,
repository_size_limit:
10
)
}
before
do
project
.
update!
(
repository_size_limit:
repository_size_limit
)
project
.
reload
end
context
'when repository_size_limit is present and have changed'
do
let
(
:repository_size_limit
)
{
20
}
it
{
expect
(
project
.
repository_size_limit
).
to
eql
(
20
*
1
.
megabyte
)
}
end
context
'when repository_size_limit is present but have not changed'
do
let
(
:repository_size_limit
)
{
10
}
it
{
expect
(
project
.
repository_size_limit
).
to
eql
(
10
*
1
.
megabyte
)
}
end
context
'when repository_size_limit is not present'
do
let
(
:repository_size_limit
)
{
nil
}
it
{
expect
(
project
.
repository_size_limit
).
to
be_nil
}
end
end
end
end
context
Group
do
context
'callback'
do
describe
'#convert_from_megabyte_to_byte'
do
let
(
:group
)
{
build
(
:group
,
repository_size_limit:
10
)
}
before
do
group
.
update!
(
repository_size_limit:
repository_size_limit
)
group
.
reload
end
context
'when repository_size_limit is present and have changed'
do
let
(
:repository_size_limit
)
{
20
}
it
{
expect
(
group
.
repository_size_limit
).
to
eql
(
20
*
1
.
megabyte
)
}
end
context
'when repository_size_limit is present but have not changed'
do
let
(
:repository_size_limit
)
{
10
}
it
{
expect
(
group
.
repository_size_limit
).
to
eql
(
10
*
1
.
megabyte
)
}
end
context
'when repository_size_limit is not present'
do
let
(
:repository_size_limit
)
{
nil
}
it
{
expect
(
group
.
repository_size_limit
).
to
be_nil
}
end
end
end
end
context
ApplicationSetting
do
context
'callback'
do
describe
'#convert_from_megabyte_to_byte'
do
let
(
:setting
)
{
ApplicationSetting
.
create_from_defaults
}
before
do
setting
.
update!
(
repository_size_limit:
10
)
setting
.
update!
(
repository_size_limit:
repository_size_limit
)
setting
.
reload
end
context
'when repository_size_limit is present and have changed'
do
let
(
:repository_size_limit
)
{
20
}
it
{
expect
(
setting
.
repository_size_limit
).
to
eql
(
20
*
1
.
megabyte
)
}
end
context
'when repository_size_limit is present but have not changed'
do
let
(
:repository_size_limit
)
{
10
}
it
{
expect
(
setting
.
repository_size_limit
).
to
eql
(
10
*
1
.
megabyte
)
}
end
end
end
end
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