找到1个结果,但正在寻找2个结果

问题描述

|| 我正在Rails 3应用程序中使用carrierwave gem上传个人资料图片。在用户的主页上,有一个更改其个人资料图片的链接。要获取个人资料图片记录的ID,我在userhome控制器中具有以下内容:
  @profile_picture = ProfilePicture.find(\"user_id = ?\",current_user.id)

  # if no profile picture record,create one
  if @profile_picture.empty?
    ProfilePicture.create(:picture => \"\",:user_id => current_user.id )
  end
我收到以下错误:
Couldn\'t find all ProfilePictures with IDs (user_id = ?,1) (found 1 results,but was looking for 2)
之前从未见过此错误,并且网络搜索没有产生任何有用的信息。 谢谢。     

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)