mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
fix the build
This commit is contained in:
parent
588667b1e4
commit
10b8eca9a6
2 changed files with 4 additions and 3 deletions
|
@ -2,8 +2,7 @@ module Jobs
|
|||
class FixAvatarInQuotes < Jobs::Base
|
||||
|
||||
def execute(args)
|
||||
user = User.find(args[:user_id])
|
||||
post_ids_to_rebake = Post.exec_sql("SELECT post_id FROM quoted_posts WHERE quoted_post_id IN (SELECT id FROM posts WHERE user_id = ?)", user.id).values.flatten.map(&:to_i)
|
||||
post_ids_to_rebake = Post.exec_sql("SELECT post_id FROM quoted_posts WHERE quoted_post_id IN (SELECT id FROM posts WHERE user_id = ?)", args[:user_id]).values.flatten.map(&:to_i)
|
||||
Post.where(id: post_ids_to_rebake).find_each.map(&:rebake!)
|
||||
end
|
||||
|
||||
|
|
|
@ -646,7 +646,9 @@ class User < ActiveRecord::Base
|
|||
Jobs.enqueue(:update_gravatar, user_id: self.id, avatar_id: avatar.id)
|
||||
end
|
||||
|
||||
Jobs.enqueue(:fix_avatar_in_quotes, user_id: self.id)
|
||||
if self.uploaded_avatar_id_changed?
|
||||
Jobs.enqueue(:fix_avatar_in_quotes, user_id: self.id)
|
||||
end
|
||||
end
|
||||
|
||||
def first_post_created_at
|
||||
|
|
Loading…
Reference in a new issue