Yes, look at dynamic attribute based finders in the activercord docs.
http://api.rubyonrails.org/classes/ActiveRecord/Base.html.

Chris

On Sun, Dec 21, 2008 at 7:39 PM, Greg Hauptmann <
[email protected]> wrote:

> Just wondering if rails has a method to look for an existing record and
> return it, but if it's not existing then create a new record.   (i.e. "FIND
> EXISTING OR CREATE NEW IF NONE FOUND"?)
>
> Then when finished updating one could use the existing "save" method which
> caters for either a new or updated record already
>
> Thanks
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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