Reputation: 187
I am looking for a solution to the problem that I will have many different users creating/signing into my web application that uses Rails, but the current application returns the same data from the database regardless of which user created/modified the data.
Is there a way that I can separate the information/data created and modified on a per user basis?
I found the following stackoverflow question that seems to be related to my issue, but was unsure if it would solve my problem and/or how to implement it. Rails - Separate Database per Subdomain
Thanks.
Upvotes: 1
Views: 685
Reputation: 1
I recommend the gem named "Acts as tenant", simple and easy to implement. https://github.com/ErwinM/acts_as_tenant
Upvotes: 0
Reputation: 122
It looks like you are looking for a way to implement multi tenancy in your application. If that is in fact what you are looking for then you could take a look at the following two videos that use default_scope:
Alternatively you could check out the apartment gem
Upvotes: 1