質問編集履歴
2
書式の改善
title
CHANGED
File without changes
|
body
CHANGED
@@ -21,6 +21,8 @@
|
|
21
21
|
#####profile.rb
|
22
22
|
```
|
23
23
|
class Profile < ApplicationRecord
|
24
|
+
has_many :coupon_profiles
|
25
|
+
has_many :coupons, through: :coupon_profiles
|
24
26
|
accepts_nested_attributes_for :coupon_profiles
|
25
27
|
end
|
26
28
|
```
|
@@ -28,6 +30,7 @@
|
|
28
30
|
```
|
29
31
|
class Coupon < ApplicationRecord
|
30
32
|
has_many :coupon_profiles
|
33
|
+
has_many :profiles, through: :coupon_profiles
|
31
34
|
end
|
32
35
|
```
|
33
36
|
|
1
改善
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
rspec
|
1
|
+
【rspec】アソシエーションのあるモデルを使いたい(Factorybot)
|
body
CHANGED
File without changes
|