[Rails] Multitenancy and the options to realise it in rails4
Ok the situation is that I have an App, where to user can sign in and can use the app save some data like customers and orders to the db.
-- Since I'm using devise for authentication, I realised the multitenenacy with current_user in the controller. So every user has his own data.
like
def index
@customers = current_user.customers
end
etc
This works fine right now. But yesterday I watched some railscast.
As you can see the first one uses pg schemas and the second one works with scopes. Both have the same effect like my way. But what could be the advantages or disadvantages to these 3 ways? Dont want to build further on my app and realise in the end that I picked the wrong way. Maybe in the end of the app there will be a function user can team up and have shared data... but this is just a nice to have.
Any experince, hints or suggestion on that?
best regards
denym_
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/610ad09f-92c4-435c-bd76-c075ca85ad37%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home