Skip to content

Connection pool breaks with classes created with Class.new(ActiveRecord::Base) #8934

@yxhuvud

Description

@yxhuvud

retrieve_connection_pool in connection_pool.rb look up connection pool by class name. However, class name is the empty string if the class is created with Class.new(ActiveRecord::Base). If several classes are created that way using different databases, then massive confusion will occur.

I see two possible resolutions to this:
1: Enforce name being != "" when executing estrablish_connection
2: use object_id instead of class name.

Not the biggest issue I guess since it is quite a bit off the normal path of doing things, but it is still not very nice to get silent breakage.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions