[Catalyst] Problems using DBIx with update_or_create()

Nathan Kurz nate at verse.com
Fri Feb 24 18:22:11 CET 2006


Apologies if this is off topic, but I'm not sure how DBIx and Catalyst
interrelate.  But I'm having a small problem using Catalyst and the
DBIx method update_or_create().  My code looks like this:

    my $user = Notate::Model::DB::User->update_or_create({
       email => $email,
       password => md5_hex($password),
    });

When I run it, I get an exception that the object method
'update_or_create' could not be found.  When I use 'create()',
everything works as expected.  I think this is just a small problem
with ResultSetProxy.pm missing some functions.  Or am I doing
something fundamentally wrong?

Thanks!

Nathan Kurz
nate at verse.com

-------------------------------------------------------------------------

--- DBIx/Class/ResultSetProxy.pm~       2006-02-08 11:33:19.000000000 -0700
+++ DBIx/Class/ResultSetProxy.pm        2006-02-24 03:14:47.000000000 -0700
@@ -10,5 +10,6 @@
 sub find           { shift->resultset_instance->find(@_);           }
 sub create         { shift->resultset_instance->create(@_);         }
 sub find_or_create { shift->resultset_instance->find_or_create(@_); }
+sub update_or_create { shift->resultset_instance->update_or_create(@_); }



More information about the Catalyst mailing list