On Fri, 31 Mar 2006, Mark Hedges wrote:

>
> It isn't obvious to me why I can't do this:
>
>  my $newsletter = $customer->newsletter;
>  my $customer_email = $customer->customer_email;
>
>  if (!$newsletter) {
>      $newsletter = C::Newsletter->new({
>          email  => $customer_email
>      });
>      warn "newsletter is a '$newsletter'\n";
>      # says it's a C::Newsletter
>  }
>  $newsletter->weekly(1);
>  $customer->newsletter( $newsletter );
>  $newsletter->update;
>  $customer->update;
>
> I get this error:
>
>  DBIx::Class::InflateColumn::update(): Not in database at <myscript> line 51

That is how you create objects and save them. However I think you may want 
to call ->update on the newsletter, before you try and set the 
$customer->newsletter value with in.

Did you manage to isolate just which of those calls is producing that 
inflate error?

Jess


_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/

Reply via email to