move uploader upload count increment from upload to post
This commit is contained in:
@@ -304,11 +304,7 @@ class UploadService
|
|||||||
end
|
end
|
||||||
|
|
||||||
def start!(uploader_id)
|
def start!(uploader_id)
|
||||||
if source.present?
|
if Utils.is_downloadable?(source)
|
||||||
if !Utils.is_downloadable?(source)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
CurrentUser.as_system do
|
CurrentUser.as_system do
|
||||||
if Post.tag_match("source:#{source}").exists?
|
if Post.tag_match("source:#{source}").exists?
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ class Post < ApplicationRecord
|
|||||||
after_commit :remove_iqdb_async, :on => :destroy
|
after_commit :remove_iqdb_async, :on => :destroy
|
||||||
after_commit :update_iqdb_async, :on => :create
|
after_commit :update_iqdb_async, :on => :create
|
||||||
after_commit :notify_pubsub
|
after_commit :notify_pubsub
|
||||||
|
after_create {|rec| rec.uploader.increment!(:post_upload_count)}
|
||||||
|
|
||||||
belongs_to :updater, :class_name => "User", optional: true # this is handled in versions
|
belongs_to :updater, :class_name => "User", optional: true # this is handled in versions
|
||||||
belongs_to :approver, class_name: "User", optional: true
|
belongs_to :approver, class_name: "User", optional: true
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ class Upload < ApplicationRecord
|
|||||||
validates :file_ext, format: { with: /jpg|gif|png|swf|webm|mp4|zip/ }, allow_nil: true
|
validates :file_ext, format: { with: /jpg|gif|png|swf|webm|mp4|zip/ }, allow_nil: true
|
||||||
validates_with Validator
|
validates_with Validator
|
||||||
serialize :context, JSON
|
serialize :context, JSON
|
||||||
after_create {|rec| rec.uploader.increment!(:post_upload_count)}
|
|
||||||
|
|
||||||
def initialize_attributes
|
def initialize_attributes
|
||||||
self.uploader_id = CurrentUser.user.id
|
self.uploader_id = CurrentUser.user.id
|
||||||
|
|||||||
Reference in New Issue
Block a user