質問編集履歴
2
書式の改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -44,6 +44,10 @@
|
|
44
44
|
|
45
45
|
class Profile < ApplicationRecord
|
46
46
|
|
47
|
+
has_many :coupon_profiles
|
48
|
+
|
49
|
+
has_many :coupons, through: :coupon_profiles
|
50
|
+
|
47
51
|
accepts_nested_attributes_for :coupon_profiles
|
48
52
|
|
49
53
|
end
|
@@ -57,6 +61,8 @@
|
|
57
61
|
class Coupon < ApplicationRecord
|
58
62
|
|
59
63
|
has_many :coupon_profiles
|
64
|
+
|
65
|
+
has_many :profiles, through: :coupon_profiles
|
60
66
|
|
61
67
|
end
|
62
68
|
|
1
改善
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
rspec
|
1
|
+
【rspec】アソシエーションのあるモデルを使いたい(Factorybot)
|
test
CHANGED
File without changes
|