We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
#!/usr/bin/perl use strict; use warnings; use Test::More; my $schema = TestSchema->connect('dbi:SQLite:dbname=:memory:'); $schema->deploy; my $rs = $schema->resultset('Foo'); # breaks Helper::Row::OnColumnMissing ok( eval { $rs->create( { id => 1, bar => [ { id => 1 } ] } ); 1; } ); is "$@", ''; is( $rs->find( { id => 1 } )->bar->count, 1 ); done_testing; BEGIN { package TestSchema::Bar; use parent 'DBIx::Class::Core'; # breaks creating related Bar from Foo __PACKAGE__->load_components('Helper::Row::OnColumnMissing'); sub on_column_missing {'die' } __PACKAGE__->table('bar'); __PACKAGE__->add_columns( id => { data_type => 'integer' }, foo_id => { data_type => 'integer' }, ); __PACKAGE__->set_primary_key('id'); package TestSchema::Foo; use parent 'DBIx::Class::Core'; __PACKAGE__->table('foo'); __PACKAGE__->add_columns( id => { data_type => 'integer' }, ); __PACKAGE__->set_primary_key('id'); package TestSchema; use parent 'DBIx::Class::Schema'; # create relationships after results are fully defined TestSchema::Bar->belongs_to( foo => 'TestSchema::Foo', 'foo_id' ); TestSchema::Foo->has_many( bar => 'TestSchema::Bar', 'foo_id' ); __PACKAGE__->register_class( Foo => __PACKAGE__ . '::Foo' ); __PACKAGE__->register_class( Bar => __PACKAGE__ . '::Bar' ); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: