File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -41,9 +41,15 @@ class Engine < Railtie
41
41
# Skip defining append_assets_path on Rails <= 4.2
42
42
unless initializers . find { |init | init . name == :append_assets_path }
43
43
initializer :append_assets_path , :group => :all do |app |
44
- app . config . assets . paths . unshift ( *paths [ "vendor/assets" ] . existent_directories )
45
- app . config . assets . paths . unshift ( *paths [ "lib/assets" ] . existent_directories )
46
- app . config . assets . paths . unshift ( *paths [ "app/assets" ] . existent_directories )
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
47
53
end
48
54
end
49
55
end
You can’t perform that action at this time.
0 commit comments