Skip to content

Conversation

@xijo
Copy link

@xijo xijo commented Nov 5, 2025

Custom locators can now implement a model_class(gid) method to control how the model class is derived from the GID. This enables mapping GID model names to different local classes without requiring matching class names.

For backward compatibility, locators without model_class will fall back to the default constantize behavior with a deprecation warning.

Recommended approach is to inherit from GlobalID::Locator::BaseLocator or GlobalID::Locator::UnscopedLocator to get default implementations.

This solves #80.

Custom locators can now implement a model_class(gid) method to control
how the model class is derived from the GID. This enables mapping GID
model names to different local classes without requiring matching class
names.

For backward compatibility, locators without model_class will fall back
to the default constantize behavior with a deprecation warning.

Recommended approach is to inherit from GlobalID::Locator::BaseLocator
or GlobalID::Locator::UnscopedLocator to get default implementations.
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

Successfully merging this pull request may close these issues.

1 participant