Apipie / apipie-rails

Ruby on Rails API documentation tool
Apache License 2.0
2.47k stars 461 forks source link

ActiveSupport::Concern::MultipleIncludedBlocks in Apipie::ApipiesController#index #627

Open anthony-bernardo opened 6 years ago

anthony-bernardo commented 6 years ago

Hello,

I get

ActiveSupport::Concern::MultipleIncludedBlocks in Apipie::ApipiesController#index

Cannot define multiple 'included' blocks for a Concern

I'm using a warden helper, in my app/controllers/concerns/warden_helper.rb

# app/controllers/concerns/warden_helper.rb
module WardenHelper
  extend ActiveSupport::Concern

  included do
    helper_method :warden, :signed_in?, :current_user

    prepend_before_action :authenticate!
  end

  def signed_in?
    !current_user.nil?
  end

  def current_user
    warden.user
  end

  def warden
    request.env['warden']
  end

  def authenticate!
    warden.authenticate!
  end

  def logout!
    warden.logout
  end
end

Any ideas ?

hopsoft commented 5 years ago

I'm using several concerns in my controllers and get this as well. Unfortunately not supporting controller concerns makes apipie a nonstarter for me.

andrepcg commented 4 years ago

Any news about this?

mathieujobin commented 4 years ago

this issue could potentially be totally unrelated with apipie

I encountered this several times when upgrading from rails 4.2 to 5.0

the solution was to not require the same class twice, or even better removing all requires and letting rails find its class through proper naming.

I would close this issue unless someone can prove this is an issue with apipie ?