[Dbix-class] stupid ?: how to create new objects & save them?

Jess Robinson castaway at desert-island.demon.co.uk
Sat Apr 1 13:54:10 CEST 2006


It apppears I was wrong.. ENODWIMMERY.

Jess


On Sat, 1 Apr 2006, Jess Robinson wrote:

>
>
> 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/
>
>



More information about the Dbix-class mailing list