diff --git a/app/models/download.rb b/app/models/download.rb index 9812839a856ffcc25eebdacee249a507b5166125..8b5dae1ad57e293b98e225a5e74fb4168eb7934f 100644 --- a/app/models/download.rb +++ b/app/models/download.rb @@ -17,9 +17,15 @@ class Download < ApplicationRecord belongs_to :downloadable, polymorphic: true, counter_cache: true belongs_to :user, optional: true - validates_presence_of :ip, :downloadable + validates :ip, :downloadable, presence: true def recipient downloadable end + + private + + def new_create_activity + new_activity(:create) unless user.nil? + end end