Skip to content

Commit

Permalink
Stop url_helpers from gathering constants from non-rails app
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Terrasa <[email protected]>
Co-authored-by: Ufuk Kayserilioglu <[email protected]>
  • Loading branch information
Morriar and paracycle committed Mar 9, 2022
1 parent 2585e8e commit 74389c7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/tapioca/dsl/compilers/url_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ def decorate

sig { override.returns(T::Enumerable[Module]) }
def self.gather_constants
return [] unless Rails.application

Object.const_set(:GeneratedUrlHelpersModule, Rails.application.routes.named_routes.url_helpers_module)
Object.const_set(:GeneratedPathHelpersModule, Rails.application.routes.named_routes.path_helpers_module)

Expand Down

0 comments on commit 74389c7

Please sign in to comment.