[Git][noosfero/noosfero][master] 2 commits: Add attribute admin username in community via api

Rodrigo Souto gitlab at mg.gitlab.com
Wed Jan 6 16:31:07 BRST 2016


Rodrigo Souto pushed to branch master at Noosfero / noosfero


Commits:
1c90626d by Thiago Ribeiro at 2016-01-06T15:09:22Z
Add attribute admin username in community via api

- - - - -
a51e24d4 by Thiago Ribeiro at 2016-01-06T15:09:28Z
Fixing migration 20151203121430

Checking if comments is empty before execute delete
statement because the clause IN has to have a argument.

Signed-off-by: Gustavo Coelho <gust.rod.coelho at gmail.com>

- - - - -


2 changed files:

- lib/noosfero/api/entities.rb
- plugins/organization_ratings/db/migrate/20151203121430_destroy_rejected_reports.rb


Changes:

=====================================
lib/noosfero/api/entities.rb
=====================================
--- a/lib/noosfero/api/entities.rb
+++ b/lib/noosfero/api/entities.rb
@@ -119,7 +119,7 @@ module Noosfero
         root 'communities', 'community'
         expose :description
         expose :admins do |community, options|
-          community.admins.map{|admin| {"name"=>admin.name, "id"=>admin.id}}
+          community.admins.map{|admin| {"name"=>admin.name, "id"=>admin.id, "username" => admin.identifier}}
         end
         expose :categories, :using => Category
         expose :members, :using => Person


=====================================
plugins/organization_ratings/db/migrate/20151203121430_destroy_rejected_reports.rb
=====================================
--- a/plugins/organization_ratings/db/migrate/20151203121430_destroy_rejected_reports.rb
+++ b/plugins/organization_ratings/db/migrate/20151203121430_destroy_rejected_reports.rb
@@ -5,7 +5,9 @@ class DestroyRejectedReports < ActiveRecord::Migration
       settings = YAML.load(task['data'])
       comments << settings[:organization_rating_comment_id]
     end
-    execute("DELETE FROM comments WHERE id IN (#{comments.join(',')})") if comments.present?
+    if !comments.empty?
+      execute("DELETE FROM comments WHERE id IN (#{comments.join(',')})")
+    end
   end
 
   def down



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/2523891c8a07c91dbde112e49207bc58c5ebcf91...a51e24d405a6f65df586e3373f5916e5cad1693f
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20160106/0e7fdf13/attachment.html>


More information about the Noosfero-dev mailing list