点赞问题

chromesetting
daiao 5 years ago
parent 42357d1f74
commit e3da03e55f

@ -1,11 +1,12 @@
json.hack do
json.(@hack, :name, :difficult, :time_limit, :description, :score, :identifier, :status)
json.(@hack, :name, :difficult, :time_limit, :description, :score, :identifier, :status, :praises_count)
json.language @hack.language
json.username @hack.user.real_name
json.code @my_hack.code
json.pass_count @hack.pass_num
json.submit_count @hack.submit_num
json.modify_code @modify
json.comments_count @hack.discusses.count
end
json.test_case do

@ -1,5 +1,6 @@
class AddPraisesCountForHacks < ActiveRecord::Migration[5.2]
def change
add_column :hacks, :praises_count, :integer, :default => 0
add_column :hacks, :comments_count, :integer, :default => 0
end
end

Loading…
Cancel
Save