Include pinned on Categories page
This commit is contained in:
parent
ac0bc1bb30
commit
459c7e3d59
|
@ -26,10 +26,11 @@ class CategoryFeaturedTopic < ActiveRecord::Base
|
|||
WHERE ft.category_id = :category_id
|
||||
AND ft.visible
|
||||
AND ft.deleted_at IS NULL
|
||||
AND ft.archetype <> '#{Archetype.private_message}'
|
||||
AND ft.archetype <> :private_message
|
||||
ORDER BY ft.bumped_at DESC
|
||||
LIMIT :featured_limit",
|
||||
category_id: c.id,
|
||||
private_message: Archetype.private_message,
|
||||
featured_limit: SiteSetting.category_featured_topics
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
require_dependency 'pinned_check'
|
||||
|
||||
class CategoryTopicSerializer < ListableTopicSerializer
|
||||
|
||||
attributes :visible, :closed, :archived
|
||||
attributes :visible, :closed, :archived, :pinned
|
||||
has_one :category
|
||||
|
||||
def pinned
|
||||
PinnedCheck.new(object, object.user_data).pinned?
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue