Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show-model and ActiveSupport::Concern don't play well together... #81

Open
epitron opened this issue Apr 5, 2016 · 0 comments
Open

Comments

@epitron
Copy link
Member

epitron commented Apr 5, 2016

There's an issue when you try to run show-model on models that have Concerns which use the included helper.

Example model:

module Concerned
  extend ActiveSupport::Concern

  included do
    scope :omg, -> { where scary: true }
  end
end

class User < ActiveRecord::Base
  include Concerned
end

Pry result:

> show-model User
Exception: ActiveSupport::Concern::MultipleIncludedBlocks: Cannot define multiple 'included' blocks for a Concern

The source of the error is: pry-rails-0.3.4/lib/pry-rails/commands/show_model.rb:17, where it calls Rails.application.eager_load!

It seems like eager_load! is doing something that's including the Concern twice. Here's some more info:

http://stackoverflow.com/questions/24244519/cannot-define-multiple-included-blocks-for-a-concern-activesupportconcern

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant