diff options
Diffstat (limited to 'app/models/concerns/packages/downloadable.rb')
-rw-r--r-- | app/models/concerns/packages/downloadable.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/models/concerns/packages/downloadable.rb b/app/models/concerns/packages/downloadable.rb new file mode 100644 index 00000000000..011f5ddda9c --- /dev/null +++ b/app/models/concerns/packages/downloadable.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Packages + module Downloadable + extend ActiveSupport::Concern + + def touch_last_downloaded_at + ::Gitlab::Database::LoadBalancing::Session.without_sticky_writes do + update_column(:last_downloaded_at, Time.zone.now) + end + end + end +end + +Packages::Downloadable.prepend_mod |