Commit 7591c28b9a93ceffaa7a9e8b6a6ab74937336b44
1 parent
413e0d3b
Exists in
organization_rating_style_changes
Add filter to clear rejected organization ratings values
Signed-off-by: Gabriel Silva <gabriel93.silva@gmail.com> Signed-off-by: Gustavo Coelho <gust.rod.coelho@gmail.com> Signed-off-by: Tallys Martins <tallysmartins@gmail.com>
Showing
2 changed files
with
16 additions
and
1 deletions
Show diff stats
src/noosfero-spb/gov_user/views/organization_ratings_extra_fields_show_institution.html.erb
1 | <% if user_rating.institution %> | 1 | <% if user_rating.institution %> |
2 | <div class="aditional-informations"> | 2 | <div class="aditional-informations"> |
3 | <div class="comments-user-institution"> | 3 | <div class="comments-user-institution"> |
4 | - <span><%=_("Institution")%> :<span> <%= user_rating.institution.name unless user_rating.institution.nil? %> | 4 | + <span><%=_("Institution")%> :<span> <%= user_rating.institution.name %> |
5 | </div> | 5 | </div> |
6 | </div> | 6 | </div> |
7 | <% end %> | 7 | <% end %> |
src/noosfero-spb/software_communities/lib/ext/create_organization_rating_comment.rb
0 → 100644
@@ -0,0 +1,15 @@ | @@ -0,0 +1,15 @@ | ||
1 | +require_dependency "create_organization_rating_comment" | ||
2 | + | ||
3 | +CreateOrganizationRatingComment.class_eval do | ||
4 | + after_save :clear_rejected_rating_values | ||
5 | + | ||
6 | + def clear_rejected_rating_values | ||
7 | + if(self.status == Task::Status::CANCELLED) | ||
8 | + puts "-----------------"*50 | ||
9 | + rating = OrganizationRating.find(self.organization_rating_id) | ||
10 | + rating.saved_value = 0 | ||
11 | + rating.people_benefited = 0 | ||
12 | + rating.save | ||
13 | + end | ||
14 | + end | ||
15 | +end |