0

I am currently developing an Rails 3.2 web app and on this app I will allow multiple tenants. In other words, this is a SaaS service where companies can create accounts.

Each company can have multiple projects which in their turn can have multiple tasks. My simple question is. Should I add account_id to both projects AND tasks tables or will it due with only on projects table? The reason I am thinking of going with both is security.

I know I can do simple associations and it works fine but is it more "secure" to add account_id to all child tables?

Sergio Tulentsev
  • 226,338
  • 43
  • 373
  • 367
Jonathan Clark
  • 19,726
  • 29
  • 111
  • 175
  • I think this is basically a DUP of this question: http://stackoverflow.com/questions/5916625/writing-a-multi-tenant-rails-3-app-for-deployment-on-heroku The video linked out of the question is pretty helpful. – Geoff Feb 03 '13 at 19:13

1 Answers1

0

I ended up using this fine gem https://github.com/ErwinM/acts_as_tenant.

Jonathan Clark
  • 19,726
  • 29
  • 111
  • 175