From a3659adeb7cca9e9fa6128f5e92cadfd9efec0e4 Mon Sep 17 00:00:00 2001 From: Braulio Bhavamitra Date: Sun, 15 May 2016 20:51:04 -0300 Subject: [PATCH] comment_paragraph: fix and comment conflict with core class --- app/api/app.rb | 2 +- plugins/comment_paragraph/lib/comment_paragraph_plugin.rb | 2 +- plugins/comment_paragraph/lib/comment_paragraph_plugin/api.rb | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/api/app.rb b/app/api/app.rb index 960ee3d..a78124a 100644 --- a/app/api/app.rb +++ b/app/api/app.rb @@ -61,7 +61,7 @@ module Api @plugins.each do |klass| if klass.public_methods.include? :api_mount_points klass.api_mount_points.each do |mount_class| - mount mount_class if mount_class && ( mount_class < Grape::API ) + mount mount_class if mount_class && ( mount_class < Grape::API ) end end end diff --git a/plugins/comment_paragraph/lib/comment_paragraph_plugin.rb b/plugins/comment_paragraph/lib/comment_paragraph_plugin.rb index c18deea..def4113 100644 --- a/plugins/comment_paragraph/lib/comment_paragraph_plugin.rb +++ b/plugins/comment_paragraph/lib/comment_paragraph_plugin.rb @@ -56,7 +56,7 @@ class CommentParagraphPlugin < Noosfero::Plugin end def self.api_mount_points - [CommentParagraphPlugin::Api] + [CommentParagraphPlugin::API] end def content_types diff --git a/plugins/comment_paragraph/lib/comment_paragraph_plugin/api.rb b/plugins/comment_paragraph/lib/comment_paragraph_plugin/api.rb index bf0d2e8..2176fb0 100644 --- a/plugins/comment_paragraph/lib/comment_paragraph_plugin/api.rb +++ b/plugins/comment_paragraph/lib/comment_paragraph_plugin/api.rb @@ -1,4 +1,7 @@ -class CommentParagraphPlugin::Api < Grape::API +# Can't be called Api as will result in: +# warning: toplevel constant Api referenced by CommentParagraphPlugin::Api +# To fix this CommentParagraphPlugin should be a module +class CommentParagraphPlugin::API < Grape::API MAX_PER_PAGE = 20 resource :articles do -- libgit2 0.21.2