File tree Expand file tree Collapse file tree 2 files changed +17
-7
lines changed Expand file tree Collapse file tree 2 files changed +17
-7
lines changed Original file line number Diff line number Diff line change 1
1
module Sprockets
2
2
module Rails
3
3
module RouteWrapper
4
+
5
+ def internal_assets_path?
6
+ path =~ %r{\A #{ self . class . assets_prefix } \z }
7
+ end
8
+
9
+ def internal?
10
+ super || internal_assets_path?
11
+ end
12
+
4
13
def self . included ( klass )
5
- klass . class_attribute ( :assets_prefix )
6
14
klass . class_eval do
7
- def assets_prefix
8
- self . class . assets_prefix
9
- end
10
-
11
15
def internal_with_sprockets?
12
- internal_without_sprockets? || path =~ %r{ \A #{ assets_prefix } \z }
16
+ internal_without_sprockets? || internal_assets_path?
13
17
end
14
18
alias_method_chain :internal? , :sprockets
15
19
end
Original file line number Diff line number Diff line change @@ -148,7 +148,13 @@ def self.build_manifest(app)
148
148
app . assets_manifest = build_manifest ( app )
149
149
150
150
ActionDispatch ::Routing ::RouteWrapper . class_eval do
151
- include Sprockets ::Rails ::RouteWrapper
151
+ class_attribute :assets_prefix
152
+
153
+ if defined? ( prepend ) && ::Rails . version >= '4'
154
+ prepend Sprockets ::Rails ::RouteWrapper
155
+ else
156
+ include Sprockets ::Rails ::RouteWrapper
157
+ end
152
158
153
159
self . assets_prefix = config . assets . prefix
154
160
end
You can’t perform that action at this time.
0 commit comments