[Dbix-class] updating a has_many relationship failure

Jon jon at texttoall.com
Tue Feb 2 16:04:13 GMT 2010

I'm building a Catalyst app using dbix class.  This is the first app I
have built using dbix-class but I have a large part of the app built
when I came across this issue.

When I attempt to update a column in a row with a has_many
relationship I get the following error, and the update fails,
Can't call method "isa" on unblessed reference at
line 59.

I think I must be doing something dumb wrong.  I just wrote some
sample code to test it,

my $album = App->model('AppDB::Albums')->find({
   album => 1
   record_label => {
       label_name => "Dischord",

which of course results in the unblessed reference error above.
Here's the table Schema definition,

(in App::Schema::Result::Albums)
__PACKAGE__->belongs_to(record_label =>

(in App::Schema::Result::RecordLabels)
__PACKAGE__->has_many(albums => 'App::Schema::Result::Albums','record_label');

There are no issues when I insert rows, only when I update.  Here are
the relevant versions I am using,
perl 5.8.8
DBIx::Class         : 0.08115
Catalyst            : 5.80015

Any ideas?  Am I doing something wrong, or could an older version of
perl be the problem?


- Jon

More information about the DBIx-Class mailing list