favors with_hidden
This commit is contained in:
@@ -9,7 +9,7 @@ class Comment < ActiveRecord::Base
|
||||
validates :user, presence: true
|
||||
|
||||
belongs_to :commentable, polymorphic: true
|
||||
belongs_to :user, -> { with_deleted }
|
||||
belongs_to :user, -> { with_hidden }
|
||||
|
||||
default_scope { includes(:user) }
|
||||
scope :recent, -> { order(id: :desc) }
|
||||
|
||||
@@ -11,7 +11,7 @@ class Debate < ActiveRecord::Base
|
||||
acts_as_taggable
|
||||
acts_as_paranoid column: :hidden_at
|
||||
|
||||
belongs_to :author, -> {with_deleted}, class_name: 'User', foreign_key: 'author_id'
|
||||
belongs_to :author, -> { with_hidden }, class_name: 'User', foreign_key: 'author_id'
|
||||
|
||||
validates :title, presence: true
|
||||
validates :description, presence: true
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<% end %>
|
||||
|
||||
<div class="comment-children">
|
||||
<%= render comment.children.with_deleted.reorder('id DESC, lft') %>
|
||||
<%= render comment.children.with_hidden.reorder('id DESC, lft') %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user