Ask A Question

Notifications

You’re not receiving notifications from this thread.

Integrating Mailboxer with Apartment

Satchit Shenoy asked in General

Hi,

I'm trying to integrate mailboxer with apartment, and am having an issue with migrating the tables. I want the mailing service to be universally applied to the app, but apartment migrates the tables for each schema. This creates multiple mailboxes for each subdomain, which is not the desired effect. There are no models to exclude with mailboxer. Is there a workaround?

Thanks,

Satchit

Reply

Oh this is an interesting one. I believe you'll have those tables in all the tenant schemas because of the way the gem works, but you'll be able to exclude the Mailboxer models so that they operate outside of the tenants like you would do with your User model for example.

Check out this section and see if that helps. I believe you'll want the migrations to run as they have already, then just add all the Mailboxer models to this config. https://github.com/influitive/apartment#excluding-models

Reply

Tried that.. Sadly, didn't work. Got an unrecognized constant error. Is there any way that I could run migrations for public domain only when it comes to mailboxer?

Reply

Hey Chris... Alright, this did work, using the scope operator - Mailbox::Conversation, etc..Thanks for pushing me to prod further :)

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 86,946+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.