On Jan 22, 12:39 pm, Pedro Bernardes <[email protected]> wrote: > but how would I do that since all the data is missing? >
Can you see it using the mongo console? I reckon the data isn't missing, mongomapper is just looking for it in the wrong collection. Fred > well, thanks for the help! I'll keep trying. > > 2011/1/22 Frederick Cheung <[email protected]> > > > > > > > On Jan 22, 3:39 am, Pedro Bernardes <[email protected]> wrote: > > > This is exactly it, I'm trying to add the topics behavior to the default > > > behavior of universities and University.all just returns [] > > > > How do I change the University? I was unable to find references to it. > > > I've only dabbled with mongomapper, but my understanding is that if > > you move from two separate collections to a single collection > > inheritance setup, you're going to need to move all the data from the > > old universities collection to the topics collection > > > Fred > > > > 2011/1/21 Frederick Cheung <[email protected]> > > > > > On Jan 21, 10:03 pm, Pedro Bernardes <[email protected]> wrote: > > > > > Hi, I'm new to this list and to rails, so I'm sorry if this subject > > is > > > > > repetead or too obvious. > > > > > > I have two models: Topic and University, both in production. I want > > to > > > > make > > > > > University to inherit from Topic, but when I do this: > > > > > > University < Topic > > > > > > My universities data just disapear (and reapears if the changes are > > > > undone). > > > > > Are you trying to setup a single table inheritance type thing? When > > > > you say that your universities data disappears, do you mean that > > > > University.all no longer returns any data? > > > > Switching from your previous setup to a single table inheritance > > > > situation means that mongomapper will be looking in the topics > > > > collection when you do University.all, so I'm not surprised that your > > > > university data would appear to vanish, if you haven't done anything > > > > to move it from its previous collection. > > > > > Fred > > > > > > I'm using mongomapper and mongodb. The code is pretty big sp I'll > > post > > > > then > > > > > only if necessarily. I think this must be easy to solve. > > > > > > ps: I've tried the deprecated _type but didn't work. > > > > > > Thanks ! > > > > > -- > > > > 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 [email protected] > > . > > > > To unsubscribe from this group, send email to > > > > [email protected]<rubyonrails-talk%2Bunsubscrib > > > > [email protected]><rubyonrails-talk%2Bunsubscrib > > [email protected]> > > > > . > > > > For more options, visit this group at > > > >http://groups.google.com/group/rubyonrails-talk?hl=en. > > > -- > > 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 [email protected]. > > To unsubscribe from this group, send email to > > [email protected]<rubyonrails-talk%2Bunsubscrib > > [email protected]> > > . > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-talk?hl=en. -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

