Commit 174f4598 authored by Alessio Caiazza's avatar Alessio Caiazza Committed by Stan Hu

Track package_file size

parent cb72d9ef
# frozen_string_literal: true
class Packages::PackageFile < ApplicationRecord
include UpdateProjectStatistics
delegate :project, :project_id, to: :package
update_project_statistics stat: :packages_size
belongs_to :package
validates :package, presence: true
......
---
title: Keep track of packages_file in ProjectStatistics
merge_request: 11020
author:
type: added
......@@ -9,4 +9,8 @@ RSpec.describe Packages::PackageFile, type: :model do
describe 'validations' do
it { is_expected.to validate_presence_of(:package) }
end
it_behaves_like 'UpdateProjectStatistics' do
subject { build(:package_file, :jar, size: 42) }
end
end
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