2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 09:10:25 +08:00

Add rubocop to our build. (#5004)

This commit is contained in:
Guo Xiang Tan 2017-07-28 10:20:09 +09:00 committed by GitHub
parent ff4e295c4f
commit 5012d46cbd
871 changed files with 5480 additions and 6056 deletions

View file

@ -38,7 +38,7 @@ class TopicTrackingState
publish_read(topic.id, 1, topic.user_id)
end
def self.publish_latest(topic, staff_only=false)
def self.publish_latest(topic, staff_only = false)
return unless topic.archetype == "regular"
message = {
@ -73,9 +73,9 @@ class TopicTrackingState
end
TopicUser
.tracking(post.topic_id)
.select([:user_id,:last_read_post_number, :notification_level])
.each do |tu|
.tracking(post.topic_id)
.select([:user_id, :last_read_post_number, :notification_level])
.each do |tu|
message = {
topic_id: post.topic_id,
@ -125,7 +125,7 @@ class TopicTrackingState
MessageBus.publish("/delete", message.as_json, group_ids: group_ids)
end
def self.publish_read(topic_id, last_read_post_number, user_id, notification_level=nil)
def self.publish_read(topic_id, last_read_post_number, user_id, notification_level = nil)
highest_post_number = Topic.where(id: topic_id).pluck(:highest_post_number).first
@ -179,8 +179,7 @@ class TopicTrackingState
end
def self.report_raw_sql(opts=nil)
def self.report_raw_sql(opts = nil)
unread =
if opts && opts[:skip_unread]
@ -205,7 +204,6 @@ class TopicTrackingState
c.id AS category_id,
tu.notification_level"
sql = <<SQL
SELECT #{select}
FROM topics