-
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
Support tenants for taggings #1000
Conversation
Hi @lunaru I this PR should be a documented opt in feature and not hardcoded into the code. the developper will have to require a file before having the tenant feature. I dont want to cause issue with existing codebases since it contain a feature migration and will change the sql queries. this feature will have a rake task to generate the migration. |
@seuros thanks for the review -- The code is actually already built so that anyone not explicitly asking for tenants (via call to As for the migration, because this gem abides by the Engines rules, the migrations will be generated. It would difficult to put it into a separate See the latest commit at 9a09ecf which accommodates this transparency. TL;DR: This PR will not impact existing production code. The new migration can be discarded with no problems. Let me know what you think of this approach |
That sound good . |
👍 often times the owner of a tag has a parent owner, for example a Post can have tags, and the Post can belong to an Account, and being able to specify a tenant (Account) for querying will help performance. Will also help querying for all tags belonging to a particular Account. |
👍 to this one! Was just about to monkey patch this library to add this feature. |
@pablo-co Glad you found this! Feel free to use the fork at https://github.com/reamaze/acts-as-taggable-on (branch name is |
Hey this is great, any plan to merge? |
This is a fantastic feature, any plan to merge it soon? @lunaru is your fork safe for production usage (seems out of sync from mbleigh:master)? Thanks! |
@apuntovanini Yes it’s safe for production usage. Why it hasn’t been merged after all this time is a mystery. It’s clearly a needed feature for any multi-tenant system and it had no negative implications for existing production deployments. @pablo-co ping one more time. |
@lunaru I will test it this weekend and have it merged. Sorry for delay. |
@seuros Wouldn't this PR deserve a release :) - Needing it for a production project 😇 |
Okay |
voila, released |
Thank you :) I wrote a bit too fast => #1036 (minor version bump soon) |
#1036 is fixed (or at least PR in review #1037) but raises 2 new issues:
if an def account_id
user.account_id
end Any particular reason for this? |
Are there any plans in making tenant as a polymorphic association? would help more with joining records than a simple string column |
@seuros Let me know if I should be tagging (pun intended) other contributors to get attention to this PR.
I'm opening up this PR to add
tenant
capabilities toacts-as-taggable-on
. Specifically this would be helpful for multi-tenant applications that will want to use atenant
column to track ownership.I know there's an
owner
concept already in this gem, but that doesn't handle the case where you want to track the user who tagged the object as well as the tenant_id for partitioning purposes.We use this gem (via a fork right now) across millions of rows and this helps keep performance sane. However, we'd love to get this change merged back into the root repo for future compatibility. It's also being introduced here in a way that will not impact existing usage syntax.
Would love to get your thoughts on the acceptability on this idea.