Skip to content

Commit 11a0387

Browse files
committed
Remove prepend conditional from RouteWrapper patch
Module#prepend was added in ruby 2.0, and the required ruby version is 2.5+ The Rails > 4 conditional will also always be true since the required Rails version is 5.2+
1 parent 15dfcb6 commit 11a0387

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

lib/sprockets/rails/route_wrapper.rb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11
module Sprockets
22
module Rails
33
module RouteWrapper
4-
54
def internal_assets_path?
65
path =~ %r{\A#{self.class.assets_prefix}\z}
76
end
87

98
def internal?
109
super || internal_assets_path?
1110
end
12-
13-
def self.included(klass)
14-
klass.class_eval do
15-
def internal_with_sprockets?
16-
internal_without_sprockets? || internal_assets_path?
17-
end
18-
alias_method_chain :internal?, :sprockets
19-
end
20-
end
2111
end
2212
end
2313
end

lib/sprockets/railtie.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,7 @@ def self.build_manifest(app)
232232
ActionDispatch::Routing::RouteWrapper.class_eval do
233233
class_attribute :assets_prefix
234234

235-
if defined?(prepend) && ::Rails.version >= '4'
236-
prepend Sprockets::Rails::RouteWrapper
237-
else
238-
include Sprockets::Rails::RouteWrapper
239-
end
235+
prepend Sprockets::Rails::RouteWrapper
240236

241237
self.assets_prefix = config.assets.prefix
242238
end

0 commit comments

Comments
 (0)