RailsCasts Pro episodes are now free!

Learn more or hide this

murtyk's Profile

GitHub User: murtyk

Comments by

Avatar

Remington,

have you found a solution?

I am just creating an admin user in create_schema method of tenant. Since admin table is there in every schema, you end up with schema (or tenant) specif admin(s). This is not too bad if you want to distribute the admin work to a team of support persons and distribute the load based on accounts/regions.

However, if you prefer to have one admin table for all schemas, then leave it in public and drop from tenant schema when you create a new tenant.

Avatar

what is the best way to load seed data for a new tenant?

how about adding load Rails.root.join("db/seed_tenant#{id}.rb") to create_schema:


def create_schema
connection.execute("create schema tenant#{id}")
scope_schema do
load Rails.root.join("db/schema.rb")
load Rails.root.join("db/seed_tenant#{id}.rb")
connection.execute("drop table #{self.class.table_name}")
end
end

Avatar

Hi Ryan,

I signed up on Railcasts today and now i feel like a kid in candy store. Too much of exciting stuff.

However, my excitement is bit tampered...I guess am having difficulty finding the right episodes.

After going through this episode, I am able to get email working but stuck at one place.

my config:

ActionMailer::Base.default_url_options = {host: "localhost:3000"}

works perfectly. But how do I make the host dynamic? I will be using heroku to host multiple domains for the same app. So my hosts will be sub1.mydomain.com, sub2.mydomain.com etc.

If you have already covered this in another episode, can you point me to it please.

Regards,
Murty