Save 36% for Black Friday! Learn more

mike vallano

Joined

120 Experience
1 Lesson Completed
0 Questions Solved

Activity

Posted in Multitenancy with the Apartment gem Discussion

Thanks to Chris, the answer, for anyone else wondering, is simply to specify your tenant in the console by using Apartment::Tenant.switch!('tenant_name') first.

So, rails c, Apartment::Tenant.switch!('tenant_name'), then Post.first will be the first post for that tenant, etc.

Posted in Multitenancy with the Apartment gem Discussion

Thanks so much for this! I've got this up and running, but I don't know how to edit/create records in the rails console once the tenants and schemas are created.

With no tenants, you can do Post.create(name: "test post), but how do you find, edit, create posts by schema from within the rails console?