Rails 求指导!!serialize 的属性取出来却是 String 型

wangping · April 10, 2014 · 2214 hits

我在 model 定义了:

serialize :html_content_datas

然后取数据是这样的

Position.select("drr.id,positions.name,
             positions.id position_id,
             cr.id client_resume_id,
             cr.html_content_datas,
             cr.clint_name,
             cr.client_phone,
             drr.created_at,
             drr.updated_at,
             drr.status,
             drr.audition_time,
             drr.audition_addr,
             drr.remark,
             drr.join_time,
             drr.join_addr,
             drr.join_remark").
      joins("inner join delivery_resume_records drr on drr.position_id = positions.id").
      joins("inner join client_resumes cr on drr.client_resume_id = cr.id").
      where(["drr.status= ? and drr.company_id= ?",status,@company.id])

结果取出来的就是 string 了。 求大神指导啊!!!

解决了: 换一下位置就可以了

Position.where(["drr.status= ? and drr.company_id= ?",status,@company.id]).select
           ("drr.id,positions.name,
             positions.id position_id,
             cr.id client_resume_id,
             cr.html_content_datas,
             cr.clint_name,
             cr.client_phone,
             drr.created_at,
             drr.updated_at,
             drr.status,
             drr.audition_time,
             drr.audition_addr,
             drr.remark,
             drr.join_time,
             drr.join_addr,
             drr.join_remark").
      joins("inner join delivery_resume_records drr on drr.position_id = positions.id").
      joins("inner join client_resumes cr on drr.client_resume_id = cr.id")

为嘛呢??

No Reply at the moment.
You need to Sign in before reply, if you don't have an account, please Sign up first.