rails3 branch migration generator broken for polymorphic models
Reported by Aleks Clark | February 9th, 2011 @ 02:53 PM | in Hobo 1.3 (Rails 3)
the hobo migration generator fails to recognize that tables for a polymorphic model have already been created & migrated, thus generating up/down migrations for these models every time it is called. Possibly another postgres conflict.
Steps to reproduce:
use hobo 1.3-pre26 & rails3 & pg gem
create model that sets :polymorphic => true
hobo g migration TWICE
observe duplicate migration generated for your model, has to be manually edited before it will run (if you had anything else you wanted to migrate, otherwise you just have a blank migration after taking out the dupe)
Comments and changes to this ticket
-
Domizio Demichelis March 27th, 2011 @ 08:11 PM
- State changed from new to hold
- Milestone set to Hobo 1.3 (Rails 3)
- Milestone order changed from 197948 to 0
-
Domizio Demichelis April 15th, 2011 @ 05:08 PM
- State changed from hold to new
- Milestone changed from Hobo 1.3 (Rails 3) to Hobo 1.4
- Milestone order changed from 11 to 0
-
Matt Jones September 14th, 2011 @ 08:31 PM
- State changed from new to investigating
- Assigned user set to Matt Jones
I'm not 100% sure what this means, but I've tested both of the likely interpretations (a polymorphic belongs_to and STI) and couldn't see any problems.
@Aleks, can you provide some example code, or at least one of the erroneous migrations?
-
Matt Jones September 25th, 2011 @ 10:24 PM
(from [3ef3252694704ef2a7a21eb4d6f3df2d189a1edd]) [#915] ignore generated :polymorphic klass shims in migration generator https://github.com/tablatom/hobo/commit/3ef3252694704ef2a7a21eb4d6f...
-
Matt Jones September 25th, 2011 @ 10:24 PM
- State changed from investigating to resolved
- Milestone changed from Hobo 1.4 to Hobo 1.3 (Rails 3)
- Milestone order changed from 4 to 0
Ran across this - not exactly sure what changed, but it definitely showed up. The underlying cause was the class we generate in
AssociationReflection
for polymorphic associations - it shares a table name with the underlying model, and was causing the model'screate_table
migration to be created twice.I've added some code to allow the generator to filter out these classes.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
People watching this ticket
Referenced by
- 915 rails3 branch migration generator broken for polymorphic models (from [3ef3252694704ef2a7a21eb4d6f3df2d189a1edd]) [#915] ...