Skip to content

Commit

Permalink
Avoid calling Bundler.require in library code
Browse files Browse the repository at this point in the history
This was causing us problems [1] in an application which uses Bundler
when we upgraded to Bundler >= v1.13.0.

I think the right solution is something along the lines of adacosta#3, but I'm
trying this as a temporary quick fix.

Note that this branch is based off the v1.0.0 tag which is the version
of the gem that we are currently using in our app.

[1]: alphagov/manuals-publisher#816
  • Loading branch information
floehopper committed May 25, 2017
1 parent 0074dbf commit 4affab7
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/mongoid_rails_migrations.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# encoding: utf-8
require 'bundler/setup'
Bundler.require(:mongoid_rails_migrations)

# Add base to path incase not included as a gem
$:.unshift(File.dirname(__FILE__)) unless
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
Expand All @@ -10,4 +7,4 @@
require 'mongoid_rails_migrations/models/data_migration'
require 'mongoid_rails_migrations/mongoid_ext/mongoid'
require 'mongoid_rails_migrations/mongoid_ext/railtie'
require 'mongoid_rails_migrations/active_record_ext/migrations'
require 'mongoid_rails_migrations/active_record_ext/migrations'

0 comments on commit 4affab7

Please sign in to comment.