Skip to content
Snippets Groups Projects
Commit 078e0566 authored by Israel Barreto Sant'Anna's avatar Israel Barreto Sant'Anna
Browse files

Ignore activity for download without user

parent bf42cc47
No related branches found
No related tags found
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment