Hello:
I have something very order to create my object
def review
@bit = Bit.find(:first,
:select => "bits.*,subjects.id as sid,
subjects.name,gaps.id as gid, gaps.gap",
:joins => "left join (subjects,gaps) on
(bits.subject_id = subjects.id and bits.gap_id = gaps.id)",
:conditions =>
"bits.status=''a'' and
next_review <= CURDATE()",
:order =>
"gap,next_review,subject_id,bits.id")
end
But when I try to save it rails complains that it is read-only. this
is true, I can see that from the @bit.inspect I put in my view. But
what is the cause?
Any help, much appreciated.
bruce
> > But when I try to save it rails complains that it is read-only. this > is true, I can see that from the @bit.inspect I put in my view. But > what is the cause?>From the ''find'' RDocs":joins: An SQL fragment for additional joins like "LEFT JOIN comments ON comments.post_id = id". (Rarely needed). The records will be returned read-only since they will have attributes that do not correspond to the table?s columns. Pass :readonly => false to override. " -- Posted via http://www.ruby-forum.com/.
Kevin: Thank you. that got it working. bruce On 8-Jan-06, at 11:55 AM, Kevin Olbrich wrote:>> >> But when I try to save it rails complains that it is read-only. this >> is true, I can see that from the @bit.inspect I put in my view. But >> what is the cause? > >> From the ''find'' RDocs > > ":joins: An SQL fragment for additional joins like "LEFT JOIN comments > ON comments.post_id = id". (Rarely needed). The records will be > returned > read-only since they will have attributes that do not correspond to > the > table?s columns. Pass :readonly => false to override. " > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails