--- trunk/sender.pl 2005/05/13 22:08:44 2 +++ trunk/sender.pl 2005/05/14 10:44:53 3 @@ -23,7 +23,7 @@ namespace => "Noticer", # additional_classes => qw/Class::DBI::AbstractSearch/, # additional_base_classes => qw/My::Stuff/, - relationships => 1 + relationships => 1, ); my $lists = $loader->find_class('lists'); @@ -40,15 +40,9 @@ } } elsif ($add_opt) { #my $noticer = $loader->find_class('Noticer') || die "can't find my class!"; - foreach my $c_name ($loader->tables) { - my $c = $loader->find_class($c_name)|| die "can't find $c_name"; - $c->autoupdate(1); - } - my $list = $lists->find_or_create({ name => $add_opt, }) || die "can't add list $add_opt\n"; - my $added = 0; while(<>) { chomp; next if (/^#/ || /^\s*$/); @@ -63,9 +57,14 @@ list_id => $list->id, }) || die "can't add user to list"; } - print "processed $added members\n"; + + foreach my $c_name ($loader->tables) { + my $c = $loader->find_class($c_name)|| die "can't find $c_name"; + $c->dbi_commit(); + } + } else { - die "$0 --lists --list-add=name_of_list --debug\n"; + die "$0 --list --add=name_of_list --debug\n"; }