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
bf29e33d
Commit
bf29e33d
authored
May 21, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename issued_at to starts_at.
parent
fda2b5ad
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
17 deletions
+17
-17
Gemfile.lock
Gemfile.lock
+1
-1
app/models/license.rb
app/models/license.rb
+2
-2
app/views/admin/licenses/show.html.haml
app/views/admin/licenses/show.html.haml
+6
-6
spec/factories.rb
spec/factories.rb
+1
-1
spec/models/license_spec.rb
spec/models/license_spec.rb
+7
-7
No files found.
Gemfile.lock
View file @
bf29e33d
...
...
@@ -219,7 +219,7 @@ GEM
diff-lcs (~> 1.1)
mime-types (~> 1.15)
posix-spawn (~> 0.3)
gitlab-license (0.0.
2
)
gitlab-license (0.0.
3
)
gitlab-linguist (3.0.1)
charlock_holmes (~> 0.6.6)
escape_utils (~> 0.2.4)
...
...
app/models/license.rb
View file @
bf29e33d
...
...
@@ -97,7 +97,7 @@ class License < ActiveRecord::Base
restricted_user_count
=
self
.
restrictions
[
:active_user_count
]
date_range
=
(
self
.
issued_at
-
1
.
year
)
..
self
.
issued
_at
date_range
=
(
self
.
starts_at
-
1
.
year
)
..
self
.
starts
_at
active_user_count
=
HistoricalData
.
during
(
date_range
).
maximum
(
:active_user_count
)
||
0
return
unless
active_user_count
...
...
@@ -107,7 +107,7 @@ class License < ActiveRecord::Base
overage
=
active_user_count
-
restricted_user_count
message
=
""
message
<<
"During the year before this license
was issu
ed, this GitLab installation had "
message
<<
"During the year before this license
start
ed, this GitLab installation had "
message
<<
"
#{
number_with_delimiter
active_user_count
}
active
#{
"user"
.
pluralize
(
active_user_count
)
}
, "
message
<<
"exceeding this license's limit of
#{
number_with_delimiter
restricted_user_count
}
by "
message
<<
"
#{
number_with_delimiter
overage
}
#{
"user"
.
pluralize
(
overage
)
}
. "
...
...
app/views/admin/licenses/show.html.haml
View file @
bf29e33d
...
...
@@ -20,12 +20,12 @@
.panel-heading
Details
%ul
.well-list
%li
%span
.light
Issued:
%strong
=
time_ago_with_tooltip
@license
.
issued_at
%li
%span
.light
Uploaded:
%strong
=
time_ago_with_tooltip
@license
.
created_at
%li
%span
.light
Started:
%strong
=
time_ago_with_tooltip
@license
.
starts_at
%li
%span
.light
-
if
@license
.
expired?
...
...
@@ -107,8 +107,8 @@
%tr
-
@license
.
licensee
.
keys
.
each
do
|
label
|
%th
=
label
%th
Issued at
%th
Uploaded at
%th
Started at
%th
Expired at
%th
Active users
%tbody
...
...
@@ -118,10 +118,10 @@
%td
=
license
.
licensee
[
label
]
%td
%span
=
license
.
issu
ed_at
=
license
.
creat
ed_at
%td
%span
=
license
.
created
_at
=
license
.
starts
_at
%td
%span
=
license
.
expires_at
||
"Never"
...
...
spec/factories.rb
View file @
bf29e33d
...
...
@@ -211,7 +211,7 @@ FactoryGirl.define do
end
factory
:gitlab_license
,
class:
"Gitlab::License"
do
issued
_at
{
Date
.
today
-
1
.
month
}
starts
_at
{
Date
.
today
-
1
.
month
}
licensee
do
{
"Name"
=>
Faker
::
Name
.
name
}
end
...
...
spec/models/license_spec.rb
View file @
bf29e33d
...
...
@@ -25,7 +25,7 @@ describe License do
describe
"Historical active user count"
do
let
(
:active_user_count
)
{
User
.
active
.
count
+
10
}
let
(
:date
)
{
License
.
current
.
issued
_at
}
let
(
:date
)
{
License
.
current
.
starts
_at
}
let!
(
:historical_data
)
{
HistoricalData
.
create!
(
date:
date
,
active_user_count:
active_user_count
)
}
context
"when there is no active user count restriction"
do
...
...
@@ -39,13 +39,13 @@ describe License do
gl_license
.
restrictions
=
{
active_user_count:
active_user_count
-
1
}
end
context
"when the license
was issu
ed"
do
context
"when the license
start
ed"
do
it
"is invalid"
do
expect
(
license
).
to_not
be_valid
end
end
context
"after the license
was issu
ed"
do
context
"after the license
start
ed"
do
let
(
:date
)
{
Date
.
today
}
it
"is valid"
do
...
...
@@ -53,16 +53,16 @@ describe License do
end
end
context
"in the year before the license
was issu
ed"
do
let
(
:date
)
{
License
.
current
.
issued
_at
-
6
.
months
}
context
"in the year before the license
start
ed"
do
let
(
:date
)
{
License
.
current
.
starts
_at
-
6
.
months
}
it
"is invalid"
do
expect
(
license
).
to_not
be_valid
end
end
context
"earlier than a year before the license
was issu
ed"
do
let
(
:date
)
{
License
.
current
.
issued
_at
-
2
.
years
}
context
"earlier than a year before the license
start
ed"
do
let
(
:date
)
{
License
.
current
.
starts
_at
-
2
.
years
}
it
"is valid"
do
expect
(
license
).
to
be_valid
...
...
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