move uploader upload count increment from upload to post

This commit is contained in:
Albert Yi
2018-06-20 10:43:48 -07:00
parent 3f6e069eed
commit 62218fdb51
3 changed files with 2 additions and 6 deletions

View File

@@ -63,7 +63,6 @@ class Upload < ApplicationRecord
validates :file_ext, format: { with: /jpg|gif|png|swf|webm|mp4|zip/ }, allow_nil: true
validates_with Validator
serialize :context, JSON
after_create {|rec| rec.uploader.increment!(:post_upload_count)}
def initialize_attributes
self.uploader_id = CurrentUser.user.id