-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Models won't save if they already have a belongs_to :tenant
and acts_as_taggable_tenant
is used
#1036
Comments
belgons_to :tenant
and acts_as_taggable_tenant
is usedbelongs_to :tenant
and acts_as_taggable_tenant
is used
same here, tenant is already an existing thing in our data modelisation, and we3 can't use the acts_as_taggable_tenant of the 8.0.0, it just breaks everything |
@lunaru a solution could be to rename tenants to less generic/more taggable specific term such as "taggable_tenant" |
@jbescoyez @ngouy namespacing this field ( |
Please note that method-level changes would be preferred since that would remove the need to run a migration for the |
From a db perspective indeed we don't need any updates. Will check it out when I have time |
@jbescoyez once new version is out check it out and tell me if it works for you. It worked here |
I didn't rename tenant_id since it's only internal logic, taggable models didn't inherit this attribute |
@ngouy I finally moved on without this gem. However, your PR is exactly the approach I would have taken. Tnx! |
How to reproduce:
Expected behavior
The tenant is created
Actual behavior
The following error is thrown.
Investigation
This is due to: https://github.com/mbleigh/acts-as-taggable-on/pull/1000/files#diff-f3570227aa94bb5887e3cb70c6a69fb30861dbecaa1ee498153371a1e10fc314R217
This line overrides the tenant method and returns an integer instead of an object.
This can be easily fixed by namescoping the method (e.g.
taggable_tenant_id
).cc @lunaru (BTW, thank you for your work 👍 )
The text was updated successfully, but these errors were encountered: