I just committed a complete solution for dealing with habtm join tables in the migration generator. Could you try it out when you get a chance?
The rename process is not quite as automatic as I'd like (you have to individually rename the table, and FKs that have changed) but it's better than nothing. --Matt Jones On Nov 5, 2009, at 3:57 PM, tmorgan99 wrote: > > So. in the meantime, you can run the code in my gist. > It reflects out the habtm declarations and generates the migration > code. > It's only a part of what the hobo_migrator, for the creation phase. > But it would be fun to link it in. > > > On Nov 5, 10:14 am, Matt Jones <[email protected]> wrote: >> On Nov 5, 2009, at 12:57 PM, tmorgan99 wrote: >> >>> But you are right, I still have to say HABTM, as in >>> A HABTM B and/or >>> B HABTM A >> >>> I cannot get away with >>> A has_many B and >>> B has_many A. >> >>> Ideally, a tool should discover a missing join table in this >>> situation. >> >> I doubt Hobo will ever have the capacity to "discover" a join table >> in >> this situation - it's simply not logical to expect it to rewrite your >> code for you. >> >> Support for explicitly declared HABTM should be arriving shortly; it >> wasn't practical until 2.3 to even try to guess the table schema, as >> habtm join tables were allowed to have "extra" fields that were >> returned in the associated records. That functionality was removed in >> 2.3, in favor of has_many :through for decorated join tables. >> >> --Matt Jones > --~--~---------~--~----~------------~-------~--~----~ > You received this message because you are subscribed to the Google > Groups "Hobo Users" 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/hobousers?hl=en > -~----------~----~----~----~------~----~------~--~--- > -- You received this message because you are subscribed to the Google Groups "Hobo Users" 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/hobousers?hl=en.
