Skip to content

Commit

Permalink
Get better at storing stuff in the DB.
Browse files Browse the repository at this point in the history
  • Loading branch information
davorg committed Jul 21, 2013
1 parent 205f452 commit 36ac47b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions PoliticalWeb/lib/PoliticalWeb.pm
Expand Up @@ -180,6 +180,16 @@ sub get_mp_from_twfy {

# debug "TWFY: MP is " . Dumper $mp;

$mp->{db} = schema->resultset('Mp')->find_or_create({
mp_name => $mp->{full_name},
twfy_id => $mp->{person_id},
});

my ($con_db) = schema->resultset('Constituency')->find_or_create({
name => $_[0],
});
$con_db->update({ mp => $mp->{db}->id });

return $mp;
}

Expand Down

0 comments on commit 36ac47b

Please sign in to comment.