Hi all, Is there a way of using Migrations or Schema_Dumper to dump the names of all the tables in the database into an array? And does AR have MTI yet? Back in Feb/March, I wrote some extensions to ActiveRecord to implement multiple-table inheritance, and another feature that I call "automated class discovery" - basically, it checks your database schema at startup and declares a class for each table. Trouble is, to make it work, I had to add a method to abstract_adapter to enumerate the tables, so I forked ActiveRecord and I''ve been using my own version ever since. Lately, I figured I''d look at how ActiveRecord is going and see if my extensions can be made to work with the current ActiveRecord head revision without needing to add to it (assuming AR doesn''t already have MTI). I feel as though I ought to be able to do what I want with Schema_Dumper, but I don''t really understand how it works. Adelle.
Answer to one of my questions is in the source code for Schema_Dumper: connection.tables Less than 5 minutes ago, I wrote:> > Is there a way of using Migrations or Schema_Dumper to dump > the names of all the tables in the database into an array? > > And does AR have MTI yet?Adelle.
Hi, Adelle, sorry that I haven''t got the answer. Your post just made me curious. I''ve searched the Archive a little but haven''t found your posts about yourself implementiung multiple-table inheritance. My question: Is this closed or open source and if it is the latter case: Do you know the reason why it didn''t made it in a ActiveRecord-release yet? Having used Hibernate in my Java-Projects I''m missing other methods than single-table-inheritance a little... regards Jan Prill Adelle Hartley wrote:>Hi all, > >Is there a way of using Migrations or Schema_Dumper to dump the names of all >the tables in the database into an array? > >And does AR have MTI yet? > >Back in Feb/March, I wrote some extensions to ActiveRecord to implement >multiple-table inheritance, and another feature that I call "automated class >discovery" - basically, it checks your database schema at startup and >declares a class for each table. > >Trouble is, to make it work, I had to add a method to abstract_adapter to >enumerate the tables, so I forked ActiveRecord and I''ve been using my own >version ever since. > >Lately, I figured I''d look at how ActiveRecord is going and see if my >extensions can be made to work with the current ActiveRecord head revision >without needing to add to it (assuming AR doesn''t already have MTI). > >I feel as though I ought to be able to do what I want with Schema_Dumper, >but I don''t really understand how it works. > >Adelle. > >_______________________________________________ >Rails mailing list >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >http://lists.rubyonrails.org/mailman/listinfo/rails > > >
Hi,> sorry that I haven''t got the answer. Your post just made me curious. > I''ve searched the Archive a little but haven''t found your > posts about yourself implementiung multiple-table > inheritance. My question: Is this closed or open source and > if it is the latter case: Do you know the reason why it > didn''t made it in a ActiveRecord-release yet? Having used > Hibernate in my Java-Projects I''m missing other methods than > single-table-inheritance a little...Well, I don''t think MTI inheritance has been a priority for the AR team, and at the time, David H wasn''t keen to accept any changes that weren''t part of a fully fledged implementation, whereas I kind of like to add one method/function/thing at a time. I don''t know that MTI belongs in AR. The consensus around here seems to be that not everyone needs it, and personally, I think it is reasonable to have MTI in a separate library for those that need it. My extensions form the basis of a closed-source program, but I am considering releasing the extensions themselves as open-source. I would be happy for them to be added to AR, if that''s what people wanted, but initially I will probably create a separate project on RubyForge. I am more than six months out of step with AR. That''s something I''m working to correct now. On the positive side, some of the adjustments that I wanted to make to AR back in February in order to make my extensions work, have since been implemented in order to add other features such as Migrations, so I feel positive about the possibility of abandoning my AR fork and switching to the latest head revision. I have never used hibernate, so I would be interested in what your expectations of MTI are. The next thing I want to add to my feature-list is the ability to mix MTI and STI - at present EVERY class requires it''s own table. My gut feeling is that an STI class should be able to inherit from either an STI or MTI class, but an MTI class should probably only be able to inherit from another MTI class. I need to think about that some more. Adelle.
> I don''t know that MTI belongs in AR. The consensus around here seems to be > that not everyone needs it, and personally, I think it is reasonable to have > MTI in a separate library for those that need it./me smells a plugin ;) -- David Heinemeier Hansson http://www.loudthinking.com -- Broadcasting Brain http://www.basecamphq.com -- Online project management http://www.backpackit.com -- Personal information manager http://www.rubyonrails.com -- Web-application framework