@@ -53,17 +53,6 @@ def precompiled_assets(clear_cache = false)
53
53
@precompiled_assets ||= assets_manifest . find ( config . assets . precompile ) . map ( &:logical_path ) . to_set
54
54
end
55
55
end
56
-
57
- class Engine < Railtie
58
- # Skip defining append_assets_path on Rails <= 4.2
59
- unless initializers . find { |init | init . name == :append_assets_path }
60
- initializer :append_assets_path , :group => :all do |app |
61
- app . config . assets . paths . unshift ( *paths [ "vendor/assets" ] . existent_directories )
62
- app . config . assets . paths . unshift ( *paths [ "lib/assets" ] . existent_directories )
63
- app . config . assets . paths . unshift ( *paths [ "app/assets" ] . existent_directories )
64
- end
65
- end
66
- end
67
56
end
68
57
69
58
module Sprockets
@@ -96,6 +85,12 @@ def configure(&block)
96
85
end
97
86
end
98
87
88
+ ::Rails ::Engine . initializer :append_assets_path , :group => :all do |app |
89
+ app . config . assets . paths . unshift ( *paths [ "vendor/assets" ] . existent_directories )
90
+ app . config . assets . paths . unshift ( *paths [ "lib/assets" ] . existent_directories )
91
+ app . config . assets . paths . unshift ( *paths [ "app/assets" ] . existent_directories )
92
+ end
93
+
99
94
config . assets = OrderedOptions . new
100
95
config . assets . _blocks = [ ]
101
96
config . assets . paths = [ ]
@@ -237,11 +232,7 @@ def self.build_manifest(app)
237
232
ActionDispatch ::Routing ::RouteWrapper . class_eval do
238
233
class_attribute :assets_prefix
239
234
240
- if defined? ( prepend ) && ::Rails . version >= '4'
241
- prepend Sprockets ::Rails ::RouteWrapper
242
- else
243
- include Sprockets ::Rails ::RouteWrapper
244
- end
235
+ prepend Sprockets ::Rails ::RouteWrapper
245
236
246
237
self . assets_prefix = config . assets . prefix
247
238
end
0 commit comments