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

Directly updating the GlobalContextRegistry doesn't clear dependents #43

Open
jturkel opened this issue Jun 15, 2023 · 0 comments
Open

Comments

@jturkel
Copy link
Member

jturkel commented Jun 15, 2023

To reproduce:

Organization.current = Organization.find(1)
# => #<Organization:0x000000011c9475d8 id: 1, ...>

# PropertyCache is dependent_on Organization
PropertyCache.current
#=> #<PropertyCache:0x000000010b2b3a48>

# Directly update the registry using [], set, with_merged_registry, or merge!
RailsMultitenant[:organization_id] = 2

Organization.current_id
# => 2

# RailsMultitenant[:organization_obj] still points to old organization
Organization.current
# => #<Organization:0x000000011c9475d8 id: 1, ...>

# Context objects dependent on organization aren't cleared out
PropertyCache.current
#=> #<PropertyCache:0x000000010b2b3a48>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant