use Class::Unload ();
use Class::Inspector ();
-our $VERSION = '0.07042';
+our $VERSION = '0.07048_01';
# Glossary:
#
class names. The values are arrayrefs of hashes containing method name and
arguments, like so:
- {
- 'Some::Source::Class' => [
- { method => 'belongs_to', arguments => [ 'col1', 'Another::Source::Class' ],
- { method => 'has_many', arguments => [ 'anothers', 'Yet::Another::Source::Class', 'col15' ],
- ],
- 'Another::Source::Class' => [
- # ...
- ],
- # ...
- }
+ {
+ 'Some::Source::Class' => [
+ { method => 'belongs_to', arguments => [
+ 'col1', 'Another::Source::Class' ] },
+ { method => 'has_many', arguments => [
+ 'anothers', 'Yet::Another::Source::Class', 'col15' ] },
+ ],
+ 'Another::Source::Class' => [
+ # ...
+ ],
+ # ...
+ }
=cut
relationship_attrs
rel_collision_map
rel_name_map
+ allow_extra_m2m_cols
_temp_classes
__tagger
/);
my $self = {
loader => $loader,
- schema => $loader->schema,
- inflect_plural => $loader->inflect_plural,
- inflect_singular => $loader->inflect_singular,
- relationship_attrs => $loader->relationship_attrs,
- rel_collision_map => $loader->rel_collision_map,
- rel_name_map => $loader->rel_name_map,
+ (map { $_ => $loader->$_ } qw(
+ schema inflect_plural inflect_singular
+ relationship_attrs rel_collision_map
+ rel_name_map allow_extra_m2m_cols
+ )),
_temp_classes => [],
};
my @link_table_primary_cols =
@{[ $self->schema->source($link_moniker)->primary_columns ]};
- next unless uniq(@{$class[0]{from_link_cols}}, @{$class[1]{from_link_cols}}) == @link_table_cols
- && @link_table_cols == @link_table_primary_cols;
+ next unless array_eq(
+ [ sort +uniq @{$class[0]{from_link_cols}}, @{$class[1]{from_link_cols}} ],
+ [ sort @link_table_primary_cols ],
+ ) && ($self->allow_extra_m2m_cols || @link_table_cols == @link_table_primary_cols);
foreach my $this (0, 1) {
my $that = $this ? 0 : 1;
$self->_temp_classes([]);
}
-=head1 AUTHOR
+=head1 AUTHORS
-See L<DBIx::Class::Schema::Loader/AUTHOR> and L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
+See L<DBIx::Class::Schema::Loader/AUTHORS>.
=head1 LICENSE