Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix index detection for HABTM invoving an STI subclass #78

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

RST-J
Copy link

@RST-J RST-J commented Nov 10, 2016

This (should) fix(es) #67 plus becomes precise about expected warnings/errors.

@plentz
Copy link
Owner

plentz commented Nov 10, 2016

@RST-J have you run the tests using rake? this way, it will test(and update) all scenarios that we support :)

@@ -8,4 +8,5 @@ class Company < ActiveRecord::Base
has_many :users

has_and_belongs_to_many :freelancers
has_and_belongs_to_many :worker_users, join_table: 'companies_users', association_foreign_key: 'user_id'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing the join_table: option here actually undermines the original intention of this PR, which was to make sure that the right join table is detected for Rails >= 4 without having this option set.
However, It should work now, even if it is not explicitly tested.

@RST-J
Copy link
Author

RST-J commented Nov 10, 2016

Yes, I used rake spec but I should have used appraisal rake spec.
Considering my comment in the code above, maybe it would be a good idea to have different setups for different rails version - though I must admit I don't know how or even whether this is possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants