質問編集履歴
1
変更
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Rails4 a
|
1
|
+
Rails4 before_createのモデル一貫性は絶対か?
|
test
CHANGED
@@ -1,47 +1,3 @@
|
|
1
|
-
act
|
1
|
+
A table生成時にbefore_createで B tableを生成した場合
|
2
2
|
|
3
|
-
編集しようとするとエラーが出ます。
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
NoMethodError at /admin/navis/10/edit
|
10
|
-
|
11
|
-
undefined method `profile_id' for #<Navi:0x007ffb23a5a1d8>
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
method_missingactivemodel (4.1.6) lib/active_model/attribute_methods.rb
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
match ? attribute_missing(match, *args, &block) : super
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
3
|
+
AとBのprimary_keyは必ず同一となるのでしょうか?
|
28
|
-
|
29
|
-
アソシエーションは下記の通りです。
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
navi model
|
34
|
-
|
35
|
-
belongs_to :exhibitor, class_name: 'Profile', foreign_key: :exhibitor_id
|
36
|
-
|
37
|
-
belongs_to :proprietor, class_name: 'Profile', foreign_key: :proprietor_id
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
profile model
|
46
|
-
|
47
|
-
has_many :navis
|