hi all,

I'm trying to use relationship proxies for updating fields in a related
table using HTML::FormHandler in a Catalyst app (the HTML::FormHandler
suggests this strategy in the cookbook). this doesn't seem to work
though. reading the relationship via the proxy accessor works fine.

here is some example code snippets to illustrate this (this is not my
actual code, but using the typical music database as an example):

in MyApp::Schema::Result::Song, I define the relationship:

    __PACKAGE__->belongs_to(
        "cd",
        "MyApp::Schema::Result::CD",
        { cd_id => "cd_id" },
        {
            is_deferrable => 1,
            on_delete => "CASCADE",
            on_update => "CASCADE",
            proxy => [ qw/title year/ ],
        }, 
    );

if I then get a song object from the database, I can read the cd title:

    my $title = $song->title;

but trying to update the cd title via the proxy on the song object
fails:

    $song->title('New titlte');
    $song->update;

this just silently does nothing (no error or warning). if I say

    $song->update({ title => 'New title' });

I get an exception.

the pod at
https://metacpan.org/module/DBIx::Class::Relationship::Base#attributes
suggests to me that this should work. so, is this expected behaviour, or
a known limitation, or bug, or am I doing something wrong?

cheers

    patrick

-- 
Patrick Meidl ........................ +43 1 9688226 (home)
Pazmanitengasse 4/10 ................. +43 680 2072780 (mobile)
1020 Wien ............................ patr...@pantheon.at
Austria .............................. http://pmeidl.homelinux.net/
--


_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk

Reply via email to