mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-02-25 16:04:22 -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
|
class FixAvatarInQuotes < Jobs::Base
|
||||||
|
|
||||||
def execute(args)
|
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 = ?)", args[: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 = ?)", user.id).values.flatten.map(&:to_i)
|
|
||||||
Post.where(id: post_ids_to_rebake).find_each.map(&:rebake!)
|
Post.where(id: post_ids_to_rebake).find_each.map(&:rebake!)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -646,7 +646,9 @@ class User < ActiveRecord::Base
|
||||||
Jobs.enqueue(:update_gravatar, user_id: self.id, avatar_id: avatar.id)
|
Jobs.enqueue(:update_gravatar, user_id: self.id, avatar_id: avatar.id)
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
def first_post_created_at
|
def first_post_created_at
|
||||||
|
|
Loading…
Reference in a new issue