favors with_hidden

This commit is contained in:
Juanjo Bazán
2015-08-20 17:52:59 +02:00
parent aff366827d
commit 896fe41db0
3 changed files with 3 additions and 3 deletions

View File

@@ -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) }

View File

@@ -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

View File

@@ -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>