File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,23 @@ def assets
36
36
# Returns Sprockets::Manifest for app config.
37
37
attr_accessor :assets_manifest
38
38
end
39
+
40
+ class Engine < Railtie
41
+ # Skip defining append_assets_path on Rails <= 4.2
42
+ unless initializers . find { |init | init . name == :append_assets_path }
43
+ initializer :append_assets_path , :group => :all do |app |
44
+ if paths [ "app/assets" ] . respond_to? ( :existent_directories )
45
+ app . config . assets . paths . unshift ( *paths [ "vendor/assets" ] . existent_directories )
46
+ app . config . assets . paths . unshift ( *paths [ "lib/assets" ] . existent_directories )
47
+ app . config . assets . paths . unshift ( *paths [ "app/assets" ] . existent_directories )
48
+ else
49
+ app . config . assets . paths . unshift ( *paths [ "vendor/assets" ] . paths . select { |d | File . directory? ( d ) } )
50
+ app . config . assets . paths . unshift ( *paths [ "lib/assets" ] . paths . select { |d | File . directory? ( d ) } )
51
+ app . config . assets . paths . unshift ( *paths [ "app/assets" ] . paths . select { |d | File . directory? ( d ) } )
52
+ end
53
+ end
54
+ end
55
+ end
39
56
end
40
57
41
58
module Sprockets
You can’t perform that action at this time.
0 commit comments