teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

sceha.rb追加

2020/05/14 08:26

投稿

KOO_
KOO_

スコア58

title CHANGED
File without changes
body CHANGED
@@ -40,4 +40,35 @@
40
40
  app/models/call.rb:26:in `call_import'
41
41
  app/controllers/customers_controller.rb:149:in `call_import'
42
42
  ```
43
- 上記、telをrowに入れインポートした際のエラーです。
43
+ 上記、telをrowに入れインポートした際のエラーです。
44
+
45
+
46
+
47
+ ```
48
+ create_table "customers", force: :cascade do |t|
49
+ t.string "company"
50
+ t.string "store"
51
+ t.string "url_2"
52
+ t.string "extraction_date"
53
+ end
54
+ ```
55
+
56
+ ```
57
+ create_table "calls", force: :cascade do |t|
58
+ t.string "statu"
59
+ t.datetime "time"
60
+ t.string "comment"
61
+ t.integer "customer_id"
62
+ t.datetime "created_at", null: false
63
+ t.datetime "updated_at", null: false
64
+ t.integer "admin_id"
65
+ t.integer "crm_id"
66
+ t.integer "customer_tel_id"
67
+ t.integer "user_id"
68
+ t.index ["admin_id"], name: "index_calls_on_admin_id"
69
+ t.index ["crm_id"], name: "index_calls_on_crm_id"
70
+ t.index ["customer_id"], name: "index_calls_on_customer_id"
71
+ t.index ["customer_tel_id"], name: "index_calls_on_customer_tel_id"
72
+ t.index ["user_id"], name: "index_calls_on_user_id"
73
+ end
74
+ ```

1

エラー文

2020/05/14 08:26

投稿

KOO_
KOO_

スコア58

title CHANGED
File without changes
body CHANGED
@@ -26,4 +26,18 @@
26
26
  belongs_to :customer
27
27
  has_many :calls
28
28
  ```
29
- 上記のようにプログラムしております。既にcallにcustomer_idは認識されておりますが、customer_telを認識させるにはどうすれば良いでしょうか?よろしくお願い致します。
29
+ 上記のようにプログラムしております。既にcallにcustomer_idは認識されておりますが、customer_telを認識させるにはどうすれば良いでしょうか?よろしくお願い致します。
30
+
31
+
32
+ ```
33
+ Completed 500 Internal Server Error in 95ms (ActiveRecord: 41.9ms)
34
+
35
+
36
+
37
+ ActiveModel::UnknownAttributeError (unknown attribute 'tel' for Call.):
38
+
39
+ app/models/call.rb:29:in `block in call_import'
40
+ app/models/call.rb:26:in `call_import'
41
+ app/controllers/customers_controller.rb:149:in `call_import'
42
+ ```
43
+ 上記、telをrowに入れインポートした際のエラーです。