Avoid warning spewing for api consts

/home/oliver/openproject/dev/lib/api/v3/render/render_api.rb:39: warning: already initialized constant API::V3::Render::RenderAPI::SUPPORTED_CONTEXT_NAMESPACES
/home/oliver/openproject/dev/lib/api/v3/render/render_api.rb:39: warning: previous definition of SUPPORTED_CONTEXT_NAMESPACES was here
/home/oliver/openproject/dev/lib/api/v3/render/render_api.rb:40: warning: already initialized constant API::V3::Render::RenderAPI::SUPPORTED_MEDIA_TYPE
/home/oliver/openproject/dev/lib/api/v3/render/render_api.rb:40: warning: previous definition of SUPPORTED_MEDIA_TYPE was here
/home/oliver/openproject/dev/lib/api/v3/render/render_api.rb:39: warning: already initialized constant API::V3::Render::RenderAPI::SUPPORTED_CONTEXT_NAMESPACES
/home/oliver/openproject/dev/lib/api/v3/render/render_api.rb:39: warning: previous definition of SUPPORTED_CONTEXT_NAMESPACES was here
/home/oliver/openproject/dev/lib/api/v3/render/render_api.rb:40: warning: already initialized constant API::V3::Render::RenderAPI::SUPPORTED_MEDIA_TYPE
/home/oliver/openproject/dev/lib/api/v3/render/render_api.rb:40: warning: previous definition of SUPPORTED_MEDIA_TYPE was here
pull/7041/head
Oliver Günther 6 years ago
parent 16ede2c200
commit ca215d36da
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 4
      lib/api/v3/render/render_api.rb

@ -36,8 +36,8 @@ module API
resources :render do
helpers do
SUPPORTED_CONTEXT_NAMESPACES = %w(work_packages projects news posts wiki_pages).freeze
SUPPORTED_MEDIA_TYPE = 'text/plain'.freeze
SUPPORTED_CONTEXT_NAMESPACES ||= %w(work_packages projects news posts wiki_pages).freeze
SUPPORTED_MEDIA_TYPE ||= 'text/plain'.freeze
def allowed_content_types
[SUPPORTED_MEDIA_TYPE]

Loading…
Cancel
Save