删除发送消息

chromesetting
daiao 5 years ago
parent ed2445b6ac
commit 726a981b33

@ -61,7 +61,7 @@ class HackUserLastestCodesController < ApplicationController
# 提交记录
def submit_records
records = @my_hack.hack_user_code
records = @my_hack.hack_user_codes
@records_count = records.count
@records = paginate records.created_order

@ -134,7 +134,7 @@ class HacksController < ApplicationController
begin
base_attrs = {
user_id: @hack.user_id, viewed: 0, tiding_type: 'System', trigger_user_id: current_user.id,
parent_container_type: "HackDelete"
parent_container_type: "HackDelete", extra: "#{@hack.name}"
}
@hack.tidings.create!(base_attrs)
@hack.destroy

@ -412,6 +412,6 @@ module TidingDecorator
end
def hack_content
I18n.t(locale_format(parent_container_type)) % container&.name
I18n.t(locale_format(parent_container_type)) % (container&.name || extra)
end
end

@ -14,7 +14,7 @@ class Hack < ApplicationRecord
# 点赞
has_many :praise_treads, as: :praise_tread_object, dependent: :destroy
# 消息
has_many :tidings, as: :container, dependent: :destroy
has_many :tidings, as: :container
belongs_to :user

Loading…
Cancel
Save