best way to add multi-tenancy support

14 views
Skip to first unread message

fair...@fieldday.ag

unread,
Apr 21, 2015, 10:05:47 AM4/21/15
to casecom...@googlegroups.com
Hello,
  I've just started using pgsearch, and it was easy to setup and get going, working great. 
  I now need to ensure search results are scoped to support multi tenancy.  I am using ActsAsTenant, with an organization_id column on most of my models.
I added an organization_id column to the pg_search_documents, and figured I could then either add acts_as_tenant to the PgSearch::Document or could filter the via  a proxy method.
  I'm wondering if others have thought thru this and have a recommended approach as the best spot to hook into this flow and modify PgSearch::Document.  I'm currently just monkey patching it, but thought I'd check to see if there were better ideas.
Thanks,
~Michael
Reply all
Reply to author
Forward
0 new messages