Chris' code did not work for me.
This is what worked for me, given I am using webpacker:
Enjoy! And I hope that helps.
Posted in In-App Messages Between Users Discussion
Would you know if one can make Mailboxer work with Action text?
Nice find! Thanks for pointing it out. It's probably enough to sway me against using apartment.
WARNING RE: Multiple schemas
For those implementing a multiple schema approach - where each customer / client / project etc. has their own schema, it is not without its problems. Consider this warning here - if you plan on using Heroku: https://devcenter.heroku.com/articles/heroku-postgresql#multiple-schemas . Granted, this is a problem that you will likely WANT to have (i.e. this means that your SAAS will have taken off into the stratosphere, if you have 50+ or more customer accounts), but it is a warning that is worth giving some pause for consideration.
Memory Bloat, Migration Problems
Tenancy by schema might be very good and quick for a small number of clients, but it seems like once you start scaling, you may run into troubles. Brad Robertson suggests are saying you may run into client memory bloat (because active record caches all tables in all schemas), so you'd get 500 mb memory bloat right off the bat. Robertson also cites anecdotal opinions that it's costing a lot more to house a database using the schema approach.
This is something that I have not looked at, at details - i don't have concrete numbers, or reasons: wondering if anyone has any thoughts on this?
(btw Chris -- thank you for your generous tutorials / time.)