[Dbix-class] schema loader fails with custom component

Seth Daniel dbix-class at sethdaniel.org
Sun Dec 19 04:20:55 GMT 2010


Hello,

I wrote a custom component (a subclass of the ToJSON helper) and I am
not placing it in the DBIx::Class namespace.  DBIC::Schema::Loader fails
to create new classes with this custom component due to a failure in a
'require'.

Example:

In my make_schema_at call:

  make_schema_at(
    ...
    components => [
      'TimeStamp',
      '+My::Custom::Component'
    ],
    ...
  );


I run the script with the above call:

  Warning: Use of "require" without parentheses is ambiguous at (eval 1007) line 1.
  syntax error at (eval 1007) line 1, near "require DBIx::Class::+"


The prepended '+' gets me past the check in _validate_class_args in
DBIC::Schema::Loader::Base, but fails when
_resolve_col_accessor_collisions blindly prepends DBIx::Class to each of
the components and attempts to require each of them.  

If there is a way around this I cannot figure out what it is.  Is this 
the intended behavior?

This is with DBIC::Schema::Loader version 0.07002.

-- 
seth /\ sethdaniel.org



More information about the DBIx-Class mailing list