From aeec6526495ba47eecf2574f8dadb74a8b6409fe Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 5 Jun 2019 18:03:07 +0800 Subject: [PATCH] 1 --- app/models/discuss.rb | 3 ++- app/services/discusses_service.rb | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/discuss.rb b/app/models/discuss.rb index 6d7ada99..b397721e 100644 --- a/app/models/discuss.rb +++ b/app/models/discuss.rb @@ -1,6 +1,7 @@ class Discuss < ActiveRecord::Base belongs_to :user - attr_accessible :user_id, :content, :dis_id, :dis_type, :parent_id, :praise_count, :root_id, :challenge_id, :position, :reward + attr_accessible :user_id, :content, :dis_id, :dis_type, :parent_id, :praise_count, :root_id, :challenge_id, + :position, :reward, :hidden default_scope :order => 'created_at desc' has_many :praise_tread, as: :praise_tread_object, dependent: :destroy diff --git a/app/services/discusses_service.rb b/app/services/discusses_service.rb index 753f3572..a43ccfa8 100644 --- a/app/services/discusses_service.rb +++ b/app/services/discusses_service.rb @@ -71,7 +71,6 @@ class DiscussesService begin base_dicuss params[:id] hidden = current_user.admin? ? false : true - Rails.logger.info("############hidden: #{hidden}") discuss = Discuss.create!(:content => params[:content].gsub(" \;", "").strip, :user_id => current_user.id, :parent_id => params[:id], :root_id => @discuss.root_id || params[:id], :praise_count => 0, :challenge_id => @discuss.challenge_id, :hidden => hidden, :dis_id => @discuss.dis_id, :dis_type => @discuss.dis_type, :position => @discuss.position)