Commit bf29e33d authored by Douwe Maan's avatar Douwe Maan

Rename issued_at to starts_at.

parent fda2b5ad
......@@ -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)
......
......@@ -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 issued, this GitLab installation had "
message << "During the year before this license started, 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)}. "
......
......@@ -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.issued_at
= license.created_at
%td
%span
= license.created_at
= license.starts_at
%td
%span
= license.expires_at || "Never"
......
......@@ -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
......
......@@ -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 issued" do
context "when the license started" do
it "is invalid" do
expect(license).to_not be_valid
end
end
context "after the license was issued" do
context "after the license started" 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 issued" do
let(:date) { License.current.issued_at - 6.months }
context "in the year before the license started" 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 issued" do
let(:date) { License.current.issued_at - 2.years }
context "earlier than a year before the license started" do
let(:date) { License.current.starts_at - 2.years }
it "is valid" do
expect(license).to be_valid
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment