質問編集履歴

1

追記依頼のschema.rbの内容を追記した。

2021/09/28 07:49

投稿

9ever
9ever

スコア10

test CHANGED
File without changes
test CHANGED
@@ -40,6 +40,10 @@
40
40
 
41
41
  エラーが出る箇所
42
42
 
43
+
44
+
45
+ Controllers/PapersController.rb
46
+
43
47
  ```
44
48
 
45
49
  class PapersController < ApplicationController
@@ -78,9 +82,9 @@
78
82
 
79
83
 
80
84
 
81
-
85
+ models/paper.rb
82
-
86
+
83
- ```ruby:models/paper.rb
87
+ ```Ruby:models/paper.rb
84
88
 
85
89
  class Paper < ApplicationRecord
86
90
 
@@ -112,10 +116,20 @@
112
116
 
113
117
  ```
114
118
 
119
+ config/environments/development.rb
120
+
115
- ```
121
+ ```
122
+
123
+ Rails.application.configure do
124
+
125
+
116
126
 
117
127
  config.active_storage.service = :amazon
118
128
 
129
+
130
+
131
+ end
132
+
119
133
  ```
120
134
 
121
135
 
@@ -134,12 +148,20 @@
134
148
 
135
149
  ActiveStorageのアップロードは非同期らしいことはわかり、それが原因かと思い、
136
150
 
137
- config/development.rbに
151
+ config/environments/development.rbに
152
+
138
-
153
+ ```Ruby:config/environments/development.rb
154
+
155
+ Rails.application.configure do
156
+
139
- ```
157
+
140
158
 
141
159
  config.active_job.queue_adapter = :inline
142
160
 
161
+
162
+
163
+ end
164
+
143
165
  ```
144
166
 
145
167
  を追記してみたのですが、エラーが出ます。
@@ -151,3 +173,99 @@
151
173
  また回避策的な解決方法でもなにかご教授いただけないでしょうか?
152
174
 
153
175
  よろしくお願いいたします。
176
+
177
+
178
+
179
+ ### 追記コード
180
+
181
+ db/schema.rb
182
+
183
+ ```Ruby:db/schema.rb
184
+
185
+ ActiveRecord::Schema.define(version: 2021_09_27_090222) do
186
+
187
+ create_table "active_storage_attachments", charset: "utf8", force: :cascade do |t|
188
+
189
+ t.string "name", null: false
190
+
191
+ t.string "record_type", null: false
192
+
193
+ t.bigint "record_id", null: false
194
+
195
+ t.bigint "blob_id", null: false
196
+
197
+ t.datetime "created_at", null: false
198
+
199
+ t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
200
+
201
+ t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
202
+
203
+ end
204
+
205
+
206
+
207
+ create_table "active_storage_blobs", charset: "utf8", force: :cascade do |t|
208
+
209
+ t.string "key", null: false
210
+
211
+ t.string "filename", null: false
212
+
213
+ t.string "content_type"
214
+
215
+ t.text "metadata"
216
+
217
+ t.bigint "byte_size", null: false
218
+
219
+ t.string "checksum", null: false
220
+
221
+ t.datetime "created_at", null: false
222
+
223
+ t.string "service_name", null: false
224
+
225
+ t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
226
+
227
+ end
228
+
229
+
230
+
231
+ create_table "active_storage_variant_records", charset: "utf8", force: :cascade do |t|
232
+
233
+ t.bigint "blob_id", null: false
234
+
235
+ t.string "variation_digest", null: false
236
+
237
+ t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
238
+
239
+ end
240
+
241
+
242
+
243
+
244
+
245
+ create_table "papers", id: :string, charset: "utf8", force: :cascade do |t|
246
+
247
+ t.string "name"
248
+
249
+ t.text "keyword"
250
+
251
+ t.datetime "created_at", null: false
252
+
253
+ t.datetime "updated_at", null: false
254
+
255
+ end
256
+
257
+
258
+
259
+
260
+
261
+ add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
262
+
263
+ add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
264
+
265
+
266
+
267
+
268
+
269
+ end
270
+
271
+ ```