RailsCasts Pro episodes are now free!

Learn more or hide this

Yvan Cottyn's Profile

GitHub User: vanne

Comments by Yvan Cottyn

Avatar

Devise works fine for me with this multi-tenancy solution with users scoped inside the tenant (user tables are inside the tenant schema, not in public) and without storing the subdomain in the user model. Well, almost works fine...

The only problem i hit was when editing registrations, because the Devise::RegistrationsController does not set the schema search path. That's easily solved by creating your own:

ruby
class RegistrationsController < Devise::RegistrationsController
  prepend_around_filter :scope_current_organization
end
ruby
devise_for :users, :controllers => { :registrations => "registrations" }