parent
cb28d59308
commit
2d3d94eafb
@ -0,0 +1,4 @@
|
|||||||
|
class ShixunReview < ApplicationRecord
|
||||||
|
belongs_to :user
|
||||||
|
belongs_to :shixun
|
||||||
|
end
|
@ -0,0 +1,16 @@
|
|||||||
|
if @content_record
|
||||||
|
json.content_info @content_record do
|
||||||
|
json.status @content_record.status
|
||||||
|
json.time format_time(@content_record.created_at)
|
||||||
|
json.username @content_record.user&.real_name
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if @perfer_record
|
||||||
|
json.perference_info @perfer_record do
|
||||||
|
json.status @perfer_record.status
|
||||||
|
json.time format_time(@perfer_record.created_at)
|
||||||
|
json.username @perfer_record.user&.real_name
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
class CreateShixunReviews < ActiveRecord::Migration[5.2]
|
||||||
|
def change
|
||||||
|
create_table :shixun_reviews do |t|
|
||||||
|
t.references :user
|
||||||
|
t.references :shixun
|
||||||
|
t.string :evaluate_content
|
||||||
|
t.integer :status
|
||||||
|
t.string :review_type
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,5 @@
|
|||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe ShixunReview, type: :model do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
Loading…
Reference in new issue