Recently I had to create a couple of records in a non-rails app database table based on a previous record. It got me thinking of how would I do this in a rails app. I tried a couple of things in the Console, but nothing works.
I want to do something like this:
001> user = User.new(User.first)
I know this doesn't work but hopefully it will show you what I an thinking. User
is a large table/model, and I only need to change a few fields. So, if I can set up a new
record with the same values in User.first
, I can then edit the fields I need to before .save
-ing the record.
Thanks for any help.