Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not dynamically load tenant model specified in autoload. #228

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Jan 18, 2024

  1. Do not dynamically load models specified in autoload.

    The basic way of Rails is that application code in the development environment is lazy loaded.
    For this reason, `class_name` is passed as a string rather than a class in the reflection definition, and the string is not constantized until it is evaluated.
    This is done to reduce performance issues and the complex locking load of constant-loading logic.
    
    Now activerecord-multitenant is loading the class specified in the argument to multi_tenant() without lazy loading.
    This conditional statement was added at citusdata#6, but I have been fixed.
    Note that for projects where the tenant model does not exist, the existing behavior is supported by specifying `skip_reflection: true`.
    alpaca-tc committed Jan 18, 2024
    Configuration menu
    Copy the full SHA
    63fe87c View commit details
    Browse the repository at this point in the history
  2. Remove unused method

    alpaca-tc committed Jan 18, 2024
    Configuration menu
    Copy the full SHA
    55863db View commit details
    Browse the repository at this point in the history