fixed a bug in Matrix deleteAttribute method

This commit is contained in:
Yung Han Khoe 2008-12-02 11:18:02 +00:00
parent bde609f5cb
commit a4207e7ec5
2 changed files with 28 additions and 0 deletions

View file

@ -449,6 +449,23 @@ sub setRatings {
=head2 view ( hasRated )
Updates the score of a MatrixListing.
=cut
sub updateScore {
my $self = shift;
my $score = $self->session->db->quickScalar("select sum(value) from MatrixListing_attribute
left join Matrix_attribute using(attributeId)
where matrixListingId = ? and fieldType = 'MatrixCompare'",[$self->getId]);
$self->update({score => $score});
return undef;
}
#-------------------------------------------------------------------
=head2 view ( hasRated )
method called by the container www_view method.
=head3 hasRated