Commit dd5ea59ffa23a960dcd763e1bf087b33f977b7ff

Authored by Victor Costa
Committed by Rodrigo Souto
1 parent b65da5af

api: fix plugin hotspot

lib/noosfero/api/api.rb
... ... @@ -38,7 +38,7 @@ module Noosfero
38 38 #finds for plugins which has api mount points classes defined (the class should extends Grape::API)
39 39 @plugins = Noosfero::Plugin.all.map { |p| p.constantize }
40 40 @plugins.each do |klass|
41   - if klass.public_methods.include? 'api_mount_points'
  41 + if klass.public_methods.include? :api_mount_points
42 42 klass.api_mount_points.each do |mount_class|
43 43 mount mount_class if mount_class && ( mount_class < Grape::API )
44 44 end
... ...
lib/noosfero/plugin.rb
... ... @@ -203,6 +203,7 @@ class Noosfero::Plugin
203 203  
204 204 # -> define grape class used to map resource api provided by the plugin
205 205 def api_mount_points
  206 + []
206 207 end
207 208 end
208 209  
... ...