On Oct 7, 2:42 pm, Bjoern <[email protected]> wrote:
> On Oct 7, 11:52 am, Frederick Cheung <[email protected]>
> wrote:
>
> > If you do User.new you will always get a new object that AR will then
> > try to insert.
>
> Any other options?
>

I think you just need to bite the bullet and find the record first.
having a neat one liner is one thing but only if it actually works.
You could hack around and fool activerecord into thinking the record
isn't new even though you've just called User.new but you'd probably
just be storing up trouble for later and increasing the chances that
your code breaks with a later version of rails.


Fred
> > Sounds like you would also get an error whenever you handle a message
> > to / from a user you have already handled a message from.
>
> True - so far I only tested it from unit tests, so I guess there was
> nothing else in the db.
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to