LoginSignup
0
0

More than 3 years have passed since last update.

モデルの複数名定義を行うNameError (uninitialized constant User::Reserf):

Posted at

環境

MacBook Air2020
Ruby2.7.1
Rails6.0.3.4
MySQL

はじめに

reserveモデルの複数形定義が、自動でreserfになる模様
エラーメッセージにて発覚しました。

NameError (uninitialized constant User::Reserf):

解決法

以下のように、複数形を定義することで解決できました。

config/initializers/inflections.rb
ActiveSupport::Inflector.inflections(:en) do |inflect|
  inflect.irregular "reserve", "reserves"
end
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0