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

Fix uninitialized constant X::ActiveRecord::VERSION #42

Merged
merged 1 commit into from
Jun 26, 2018

Conversation

vollnhals
Copy link
Contributor

When the class that calls multi_tenant has another ActiveRecord class included, then this reference may resolve to the wrong ActiveRecord class. Make sure that does not happen by using ::ActiveRecord.

This happened for example if activerecord-multi-tenant and mobility gem were used in the same project.

NameError (uninitialized constant Mobility::ActiveRecord::VERSION)
class Model < ApplicationRecord
  extend Mobility

  multi_tenant :tenant
end

The mobility gem defines a class named Mobility::ActiveRecord and includes that into the class above.

When the class that calls `multi_tenant` has another ActiveRecord class included, then this reference may resolve to the wrong ActiveRecord class. Make sure that does not happen by using ::ActiveRecord.

This happened for example if activerecord-multi-tenant and mobility gem were used in the same project.
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.

2 participants