質問編集履歴

1

アソシエーションの記述を修正しました。

2017/11/02 09:11

投稿

merryken
merryken

スコア30

test CHANGED
File without changes
test CHANGED
@@ -6,9 +6,9 @@
6
6
 
7
7
  class Post < ActiveRecord::Base
8
8
 
9
- belongs_to :video
9
+ has_one :video
10
10
 
11
- belongs_to :image
11
+ has_one :image
12
12
 
13
13
  end
14
14
 
@@ -16,7 +16,7 @@
16
16
 
17
17
  class Video < ActiveRecord::Base
18
18
 
19
- has_one :post
19
+ belongs_to :post
20
20
 
21
21
  end
22
22
 
@@ -24,7 +24,7 @@
24
24
 
25
25
  class Image < ActiveRecord::Base
26
26
 
27
-  has_one :post
27
+  belongs_to :post
28
28
 
29
29
  end
30
30