Friday, October 1, 2010

[Rails] Re: NoMethodError

Fred post::::

On Oct 1, 11:32 pm, Pedro <pogerm...@gmail.com> wrote:
> It is running, but not saving, is there a commit like command?

No. The problem is that because you've only selected the address
column rails can't save the object, because it doesn't know its id.
Fred


Michael Pavlin post :

On 1 October 2010 23:42, Pedro <pogerm...@gmail.com> wrote:
> So, what I have to do? Use c =Cartcid.find(:all) instead?

Firstly, please quote what you're replying to, because your last two
posts make no sense out of context.
>On 1 October 2010 23:35, Frederick Cheung <frederick.che...@gmail.com> wrote:
>> No. The problem is that because you've only selected the address
>> column rails can't save the object, because it doesn't know its id.

Secondly, what did you try in response to Fred pointing out you'd
only
selected the address? You could use .find(:all) (or .all) or you
could
"SELECT * ..." in your find_by_sql.


Im using find_by_sql(["SELECT address, lat, lng FROM
cartcid WHERE ADDRESS IS NOT NULL"]) because the table have 60.000
rows, with blob field. This choice was made thinking in performance
issues. So "select" would improve performance. Now I include the
primary key on select and it works.

Thanks to all of you,

Pedro

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate