Skip to content

Commit d77f164

Browse files
authored
Merge pull request linuxfrorg#270 from Trim/hide-comments-of-invisible-content-in-footer
footer: hide comments of invisible content
2 parents 5870e9c + 8f8d927 commit d77f164

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/models/comment.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Comment < ActiveRecord::Base
3131
scope :under, ->(path) { where("materialized_path LIKE ?", "#{path}_%") }
3232
scope :published, -> { where(state: 'published') }
3333
scope :on_dashboard, -> { published.order(created_at: :desc) }
34-
scope :footer, -> { published.order(created_at: :desc).limit(12).select([:id, :node_id, :title]) }
34+
scope :footer, -> { published.joins(:node).merge(Node.visible).order(created_at: :desc).limit(12).select([:id, :node_id, :title]) }
3535

3636
validates :title, presence: { message: "Le titre est obligatoire" },
3737
length: { maximum: 100, message: "Le titre est trop long" }

0 commit comments

Comments
 (0)