Greetings all,

  I have some active_record models which have same columns, for
instance:

model A (int id, vchar name, vchar code)
model B (int id, vchar name, vchar code)

I can initiate a new model B object using "b = B.new", assuming that I
already have an "a" acquired by A.find(), how can I assign the column
values of "a" to object "b" easily like:

[code]
b = B.new(a)
b.save
[/code]

Cheers,
Difei
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to