Closed jbescoyez closed 3 years ago
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 (taggable_tenant
and taggable_tenant_id
) makes sense. PRs welcome!
Please note that method-level changes would be preferred since that would remove the need to run a migration for the tenant
column in the taggings
table
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
@jbescoyez @ngouy namespacing this field (
taggable_tenant
andtaggable_tenant_id
) makes sense. PRs welcome!
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 👍 )