Skip to content

Instantly share code, notes, and snippets.

@johnthethird
Created August 30, 2012 04:49
Show Gist options
  • Select an option

  • Save johnthethird/3522478 to your computer and use it in GitHub Desktop.

Select an option

Save johnthethird/3522478 to your computer and use it in GitHub Desktop.
def after_create(model)
orig_tenant = (Tenant.current rescue Kexception::TenantNotFoundError)
Tenant.current = model.tenant
...
ensure
Tenant.current = orig_tenant
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment