Hi,
Check the following data model:
class BaseClass < ActiveRecord::Base; end
class Class1 < BaseClass; end
class Class2 < BaseClass; end
For some reasons, I would like to “convert” a Class1 object to a Class2
object.
Creating a new Class2 object from Class1 object is not a solution, since
Class1 object is associated to lots of objects and I do not want to
recreate the associations.
obj = BaseClass.find()
=> how to cast obj from Class1 to Class2
Thank you!
Jean-Etienne