回答編集履歴

1

persisted?よりnew_record?の方が適切

2021/05/10 04:42

投稿

asm
asm

スコア15149

test CHANGED
@@ -26,7 +26,7 @@
26
26
 
27
27
 
28
28
 
29
- after_initialize :stripe_product_init, unless: :persisted?
29
+ after_initialize :stripe_product_init, if: :new_record?
30
30
 
31
31
 
32
32