Skip to content

Upgrading to version 6.0

Brandon Zylstra edited this page Sep 29, 2023 · 3 revisions

In version 6.0, we made several architectural changes to make the gem work more easily with the zeitwerk class loader, which is required in Rails starting with version 7.0.

Here's what you need to do to make your existing app adapt to the new changes:

  1. There is no longer a UcbRailsUser::User class. Following the pattern used by Devise, this gem has functionality to help you generate a user class if you need one, but the actual user class should now live in the host app. By default, the gem will expect the class to be User, but this can be configured (see the README for details). For existing apps:

    • remove any references to UcbRailsUser::User
    • define a User class (if you haven't already) and make sure it includes the following line:
      • include UcbRails::UserConcerns
  2. Some of the namespaces for concerns have been changed to make them work better with zeitwerk, and to make them more consistent. You may not be using all (or even any) of these concerns, but if you are, use the following table to rename any references you might have in your code:

Old name New Name
UcbRailsUser::Concerns::ImpersonationConcerns UcbRailsUser::ImpersonationConcerns
UcbRailsUser::Concerns::UserConcerns UcbRailsUser::UserConcerns
UcbRailsUser::Concerns::UserRolesConcerns UcbRailsUser::UserRolesConcerns
UcbRailsUser::Concerns::ControllerMethods UcbRailsUser::AuthConcerns
UcbRailsUser::Concerns::HomeController UcbRailsUser::HomeControllerConcerns
UcbRailsUser::Concerns::ImpersonationsController UcbRailsUser::ImpersonationsControllerConcerns
UcbRailsUser::Concerns::SessionsController UcbRailsUser::SessionsControllerConcerns
UcbRailsUser::Concerns::UsersController UcbRailsUser::UsersControllerConcerns
  1. Add these lines to the top of config/initializers/ucb_rails_user:
require "ucb_rails_user/configuration/email"
require "ucb_rails_user/configuration/ldap"
require "ucb_rails_user/configuration/cas"
Clone this wiki locally