質問編集履歴

2

日本語対応

2021/03/03 04:08

投稿

fastman
fastman

スコア3

test CHANGED
File without changes
test CHANGED
@@ -263,3 +263,17 @@
263
263
  from /Users/ユーザ名/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.5/lib/active_record/validations.rb:80:in `raise_validation_error'
264
264
 
265
265
  ```
266
+
267
+
268
+
269
+ [本記事](https://qiita.com/nkekisasa222/items/0c566ced53f7ee47d67d)を参考にしたところ、以下のようなエラー文が返ってきました
270
+
271
+ ```console
272
+
273
+ [1] pry(main)> Room.create!(thread_name: "ルーム1", user_ids: [1, 2])
274
+
275
+ ActiveRecord::RecordInvalid: バリデーションに失敗しました: Usersは不正な値です
276
+
277
+ from /Users/ ユーザ名/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.5/lib/active_record/validations.rb:80:in `raise_validation_error'
278
+
279
+ ```

1

Rails.create!の実行結果追記

2021/03/03 04:08

投稿

fastman
fastman

スコア3

test CHANGED
File without changes
test CHANGED
@@ -249,3 +249,17 @@
249
249
 
250
250
 
251
251
  お手数ですがご教授願えると幸いです
252
+
253
+
254
+
255
+ ### 追記
256
+
257
+ ```console
258
+
259
+ [1] pry(main)> Room.create!
260
+
261
+ ActiveRecord::RecordInvalid: translation missing: ja.activerecord.errors.messages.record_invalid
262
+
263
+ from /Users/ユーザ名/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activerecord-6.0.3.5/lib/active_record/validations.rb:80:in `raise_validation_error'
264
+
265
+ ```