我正在保存这样的哈希会话:
session[:review] = {:content => params[:review], :rating => params[:rating], :school_id => params[:school_id]}
当我像这样将它保存到数据库时:
Review.create!(:content => session[:review][:content], :school_id => session[:review][:school_id], :user_id => current_user, :rating => session[:review][:rating])
它将值保存到一列中,如下所示:
--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess
rating: '1'
content: somehting skjnfjkbf
为什么以及如何解决这个问题?