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

Merge branch 'download_activity' into 'master'

Ignore activity for download without user

See merge request !410
parents bf42cc47 078e0566
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