Hi people I''ve just submitted a patch that adds CTI to ActiveRecord. It''s not quite done yet - some stuff is untested, and associations (probably) don''t work with CTI classes. But you can read and write CTI records with no special syntax (it looks just like STI). I''ve posted more details on my company''s blog here: http:// pdcm.codeweavers.net/2006/11/7/class-table-inheritance-in-activerecord And you can download the patch from the Rails trac: http:// dev.rubyonrails.org/ticket/6566 The patch is quite large - it was a lot trickier to make it work than I thought at first because ActiveRecord has a few assumptions that only hold under STI. I''ve avoided nasty hacks but it still took some voodoo meta-programming to preserve the existing functionality. Class-table inheritance is one of the big feature we want at my company before we start any big Rails apps. If anyone would like to use it in their own projects don''t wait to let me know :) I''m hoping I can finish it off in a week or two. It''s hard to gauge the demand for CTI because not many people have attempted it so far. Ashley --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 7-Nov-06, at 10:55 AM, Ashley Moran wrote:> Hi people > > I''ve just submitted a patch that adds CTI to ActiveRecord. It''s not > quite done yet - some stuff is untested, and associations (probably) > don''t work with CTI classes. But you can read and write CTI records > with no special syntax (it looks just like STI).very exciting Ashley! I have a project coming around the bend where this will be very useful. thank you. Jodi --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 7 Nov 2006, at 18:38, Jodi Showers wrote:> I have a project coming around the bend where this will be very > useful. > > thank you. > JodiCool. I was hoping it would be useful to other people. There''s still a fair bit to do though, but I''m hoping to have it finished completely in 2-3 weeks. If anyone from the core team is watching, does this look like something that could make it into the ActiveRecord core? The patch is pretty hefty, and there''s no way it could be maintained as a plug- in. If so, I could do with discussing the rest of the tests before I do any more work, as it''s quite a fundamental change to the way ActiveRecord maps objects to tables. I can''t tell you how much I''d love this to be in 1.2 :) Ashley --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi Ashley Thanks for you post, I''m exactly looking for a Class Table Inheritance pattern for Rails. I see now (after 6 months) your patch, and I wondering if you are still working on it. Please, can you give me some update on your research? Thanks -- 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-/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 -~----------~----~----~----~------~----~------~--~---