我想使用以下命令在数据库中upup记录
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模型
但我得到以下错误
undefined method find_or_create for Profile class
Profile.public_methods不显示find_or_create方法,但Activerecord Api定义了上述方法.
可能有什么问题?
@H_404_14@