質問編集履歴
1
app/models/reaction.rbを追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -61,3 +61,21 @@
|
|
61
61
|
end
|
62
62
|
|
63
63
|
```
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
app/models/reaction.rb
|
68
|
+
|
69
|
+
```ruby
|
70
|
+
|
71
|
+
class Reaction < ApplicationRecord
|
72
|
+
|
73
|
+
belongs_to :to_user, class_name: "User"
|
74
|
+
|
75
|
+
belongs_to :from_user, class_name: "User"
|
76
|
+
|
77
|
+
enum status: { like: 0, dislike: 1 }
|
78
|
+
|
79
|
+
end
|
80
|
+
|
81
|
+
```
|