Subject: | confusion with schema_base_class loader option when it overrides connection() |
Hi. I tried using schema_base_class with make_schema_at()
loader_options. Except that base class overrides connection(). When
Loader calls connection(), it calls it as a class method instead of an
object method. When DBIx::Class::Schema's connect() calls connection(),
it has already instantiated an object and calls connection() as an
object method.
This caused some confusion for me because my overloaded connection()
method uses object attributes to keep track of what it does the
connection is first established. Other schema objects may use the same
base class and will need to use their object attributes to keep that
state for each one.
I worked around this by checking (ref $self) when I do stuff in the
overloaded connection() method in my schema base class. That seems a
little awkward. Would it make sense for make_schema_at() to call
connect() instead of connection()?
Thanks. HTH. -Mark