mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
Fix all the trailing whitespace
This commit is contained in:
@ -3,7 +3,7 @@ require_dependency 'age_words'
|
||||
class BasicTopicSerializer < ApplicationSerializer
|
||||
include ActionView::Helpers
|
||||
|
||||
attributes :id, :title, :reply_count, :posts_count, :highest_post_number, :image_url, :created_at,
|
||||
attributes :id, :title, :reply_count, :posts_count, :highest_post_number, :image_url, :created_at,
|
||||
:last_posted_at, :age, :unseen, :last_read_post_number, :unread, :new_posts
|
||||
|
||||
def age
|
||||
@ -11,17 +11,17 @@ class BasicTopicSerializer < ApplicationSerializer
|
||||
end
|
||||
|
||||
def seen
|
||||
object.user_data.present?
|
||||
object.user_data.present?
|
||||
end
|
||||
|
||||
def unseen
|
||||
return false if scope.blank?
|
||||
return false if scope.user.blank?
|
||||
return false if scope.user.blank?
|
||||
return false if object.user_data.present?
|
||||
return false if object.created_at < scope.user.created_at
|
||||
|
||||
# Only mark things as new since your last visit
|
||||
if scope.user.previous_visit_at.present?
|
||||
if scope.user.previous_visit_at.present?
|
||||
return false if object.created_at < scope.user.previous_visit_at
|
||||
end
|
||||
|
||||
@ -50,4 +50,4 @@ class BasicTopicSerializer < ApplicationSerializer
|
||||
@unread_helper ||= Unread.new(object, object.user_data)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user