-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Document Support for has_and_belongs_to_many (HABTM) tables #34
Comments
Hi, This is currently not supported (I guess the README could be more explicit about this), as we use model classes to generate the seed file. I think this would be a great feature, but sadly I can't guarantee that I'll have time to work on this anytime soon. As usual, I'd be very happy to take a look at a PR of you want to implement this feature :) |
Dug into this a bit this evening, and it appears that the class Product
has_and_belongs_to_many :categories
end
class Category
has_and_belongs_to_many :products
end We get two backing HABTM models: SeedMigration.register Category::HABTM_Products I'd be happy to submit a PR with the test and some documentation for this. |
@tbloncar still interested in submitting a PR for this? |
I also found that the implicit model exists (though it's a private constant). However, when I register the model, I'm getting an error because the join table does not have an
I tried to exclude the |
I am happy to review a PR, but I won't have time to work on this for some time. |
Yea, I forked the repo and am planning to work on a fix today. I'll link it here and open a PR when ready. |
Is it possible to add support to has_and_belongs_to_many tables that has no model ?
The text was updated successfully, but these errors were encountered: