noosfero | Organization Ratings plugin improvements (#737)

Daniela Feitosa gitlab at mg.gitlab.com
Tue Dec 1 13:46:57 BRST 2015


New comment for Merge Request 737

https://gitlab.com/noosfero/noosfero/merge_requests/737#note_2816506


Daniela Feitosa

This `:check_display_comment` on before_save will execute in both cases: on approval and rejection. I think you don't need this...

When rejecting a task, the "cancel" method from task is called (https://gitlab.com/noosfero/noosfero/blob/master/app/models/task.rb#L108). You could use it, like this **_not tested_** method:
```
def cancel(closed_by=nil)
  super
  @rating = OrganizationRating.find_by_id(self.organization_rating_id)
  @rating.comment_rejected = true if self.rejected?
  @rating.save
end
```

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20151201/c63f47a6/attachment.html>


More information about the Noosfero-dev mailing list