* Enable new Rails/* cops and use autocorrect on them * Fixed Rails/PluckInWhere leftovers * Fix Rails/DefaultScope * Enable and fix Rails/PluckId * Fix manual mistake with forcing autocorrection on Rails/PluckId * Apply PR feedback to remove Rails/PluckId inline disables * Apply PR feedback to get rid of Rails/PluckInWhere inline
18 lines
393 B
Ruby
18 lines
393 B
Ruby
module Comments
|
|
class CreateFirstReactionWorker
|
|
include Sidekiq::Worker
|
|
|
|
sidekiq_options queue: :high_priority, retry: 10
|
|
|
|
def perform(comment_id, user_id)
|
|
return unless Comment.exists?(id: comment_id)
|
|
|
|
Reaction.create(
|
|
user_id: user_id,
|
|
reactable_id: comment_id,
|
|
reactable_type: "Comment",
|
|
category: "like",
|
|
)
|
|
end
|
|
end
|
|
end
|