Skip to content

Commit

Permalink
Merge pull request #500 from Shopify/at-fix-rails
Browse files Browse the repository at this point in the history
Load the Rails application before loading the gems
  • Loading branch information
paracycle authored Sep 15, 2021
2 parents df16bdc + 14cbbc9 commit 9e8f51f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/tapioca/loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ class Loader
def load_bundle(gemfile, initialize_file, require_file)
require_helper(initialize_file)

gemfile.require_bundle

load_rails_application

gemfile.require_bundle

require_helper(require_file)

load_rails_engines
Expand Down
6 changes: 6 additions & 0 deletions spec/support/gems/bar/lib/bar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ def self.bar(a = 1, b: 2, **opts)
39 + a + b + number
end
end

# Used to check we load the Rails application before the gems
#
# We try to access the `Rails::Application` constant defined in the `config/application.rb` of the support repo.
# If the application is not loaded before the gems, this call will fail.
puts Rails::Application

0 comments on commit 9e8f51f

Please sign in to comment.