Is it possible to define a model that is not backed by a database table and still relate other models to it? Will relations between instances of these models persist? For instance, say I have a Cat model that does not inherit from ActiveRecord and an Owner model that does. Can I assign a particular cat to an owner? The next time I load the app will that pair be remembered? --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
MaurĂcio Linhares
2009-Feb-28 02:36 UTC
Re: Associating ActiveRecord and non-ActiveRecord objects
No. Unless you roll your own solution or persist the cat at the database in a way or another. - MaurĂcio Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) On Sat, Feb 28, 2009 at 12:27 AM, Evan <evanchaney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Is it possible to define a model that is not backed by a database > table and still relate other models to it? Will relations between > instances of these models persist? > > For instance, say I have a Cat model that does not inherit from > ActiveRecord and an Owner model that does. Can I assign a particular > cat to an owner? The next time I load the app will that pair be > remembered? > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---