pinnymz / migration_comments

Comments for your migrations
MIT License
173 stars 31 forks source link

v0.4.0 connection adapters regression #32

Closed kenaniah closed 8 years ago

kenaniah commented 8 years ago

After running bundle update migration_comments to update from v0.3.2 to v0.4.0, a regression occurs when attempting to run Rails. Using Rails 4.2.6 and the postgres Active Record connection adapter.

Output from rails -c:

...gems/bundler-1.12.5/lib/bundler/rubygems_integration.rb:322:in `block in replace_gem': mysql2 is not part of the bundle. Add it to Gemfile. (Gem::LoadError)
    from ...gems/activerecord-4.2.6/lib/active_record/connection_adapters/mysql2_adapter.rb:3:in `<top (required)>'
    from ...gems/migration_comments-0.4.0/lib/migration_comments.rb:34:in `require'
    from ...gems/migration_comments-0.4.0/lib/migration_comments.rb:34:in `block in setup'
    from ...gems/migration_comments-0.4.0/lib/migration_comments.rb:32:in `each'
    from ...gems/migration_comments-0.4.0/lib/migration_comments.rb:32:in `setup'
    from ...gems/migration_comments-0.4.0/lib/migration_comments.rb:60:in `<top (required)>'
    from ...gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `require'
    from ...gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `block (2 levels) in require'
    from ...gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `each'
    from ...gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `block in require'
    from ...gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `each'
    from ...gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `require'
    from ...gems/bundler-1.12.5/lib/bundler.rb:102:in `require'
    from ...my-rails-app/config/application.rb:15:in `<top (required)>'
    from ...gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:141:in `require'
    from ...gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:141:in `require_application_and_environment!'
    from ...gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:67:in `console'
    from ...gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
    from ...gems/railties-4.2.6/lib/rails/commands.rb:17:in `<top (required)>'
    from bin/rails:8:in `require'
    from bin/rails:8:in `<main>'
kenaniah commented 8 years ago

Reading the source code, it appears that https://github.com/pinnymz/migration_comments/blob/master/lib/migration_comments.rb#L31 is the culprit. v0.4.0 currently throws an error whenever one of the adapters in the list is not installed.

pinnymz commented 8 years ago

@kenaniah thanks for reporting this, can you check if the 'regression_loading_adapters' branch resolves this problem?

pinnymz commented 8 years ago

I've verified the problem, and confirmed that this fix is working. I'll be pushing out a new version shortly.