次のコマンドを使用して、データベースのレコードをアップサートしたい
Profile.find_or_create(fname: contact.FirstName, lname: contact.LastName,
company: account.Name, title: contact.Title, user_id: contact.CreatedById,
account_id: account.Id, contact_id: contact.Id, type: "contact" )
はどこProfile
ですかactiverecord model
しかし、次のエラーが発生します
undefined method find_or_create for Profile class
Profile.public_methods
find_or_create
メソッドは示していませんがActiverecord Api
、上記のメソッドを定義しています。
何が間違っている可能性がありますか?