ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> rubyonrails-talk
rubyonrails-talk
[Rails] Moving a record
by Wiz561@Gmail.Com other posts by this author
Aug 13 2007 11:19AM messages near this date
[Rails] [ANN] SqueezeBox, a simple file system based routing framework | [Rails] Re: Moving a record
Hi!

I'd like to move a record from one table to another.  I've been
reading the documentation, and I think I can accomplish this by
finding the record, creating a new record with those attributes, and
then removing the first one.  First, is there a better way to do this?

Next question, if I do go this way, do I have to specify every column
that is going to be inserted into the database?  For example, I would
have to do this....

.new(:col1 =>  blah, :col2 => blah, :col3 => blah).save

or can I just use the results from the previous find and insert them
into the .new() part?  I tried to put the @results in
(.new(@results).save), but that obviously didn't work.


Thanks!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Ta
lk" group.
To post to this group, send email to rubyonrails-talk@[...].com
To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@[...].com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Thread:
Wiz561@Gmail.Com
Matthew Isleb
Wiz561@Gmail.Com
Matthew Isleb

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved