Commit dd5ea59ffa23a960dcd763e1bf087b33f977b7ff
Committed by
Rodrigo Souto
1 parent
b65da5af
Exists in
staging
and in
41 other branches
api: fix plugin hotspot
Showing
2 changed files
with
2 additions
and
1 deletions
Show diff stats
lib/noosfero/api/api.rb
| @@ -38,7 +38,7 @@ module Noosfero | @@ -38,7 +38,7 @@ module Noosfero | ||
| 38 | #finds for plugins which has api mount points classes defined (the class should extends Grape::API) | 38 | #finds for plugins which has api mount points classes defined (the class should extends Grape::API) |
| 39 | @plugins = Noosfero::Plugin.all.map { |p| p.constantize } | 39 | @plugins = Noosfero::Plugin.all.map { |p| p.constantize } |
| 40 | @plugins.each do |klass| | 40 | @plugins.each do |klass| |
| 41 | - if klass.public_methods.include? 'api_mount_points' | 41 | + if klass.public_methods.include? :api_mount_points |
| 42 | klass.api_mount_points.each do |mount_class| | 42 | klass.api_mount_points.each do |mount_class| |
| 43 | mount mount_class if mount_class && ( mount_class < Grape::API ) | 43 | mount mount_class if mount_class && ( mount_class < Grape::API ) |
| 44 | end | 44 | end |
lib/noosfero/plugin.rb
| @@ -203,6 +203,7 @@ class Noosfero::Plugin | @@ -203,6 +203,7 @@ class Noosfero::Plugin | ||
| 203 | 203 | ||
| 204 | # -> define grape class used to map resource api provided by the plugin | 204 | # -> define grape class used to map resource api provided by the plugin |
| 205 | def api_mount_points | 205 | def api_mount_points |
| 206 | + [] | ||
| 206 | end | 207 | end |
| 207 | end | 208 | end |
| 208 | 209 |