Displaying 1 result from an estimated 1 matches for "new_patient".
Did you mean:
new_parent
2009 Aug 06
2
duplicate model object with associations ?
class Patient < AR::Base
has_many :aaas
has_many :bbbs ,:through=>:aaas
end
class Aaa < AR::Base
has_many :bbbs
end
-------
i want like this
@patient=Patient.find(id)
@new_patient=@patient.duplicate
now the
@new_patient should have their own copy of patient,aaas,bbbs (new
records in corresponding tables)
there is one options is that
we can create seperate object for each patient,aaas(Array),bbbs(Array)
and save them, but if the associations(aaas,bbbs) size(Array.size) are...