File tree 2 files changed +4
-10
lines changed
2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,8 @@ module React
2
2
module Rails
3
3
class Engine < ::Rails ::Engine
4
4
initializer "react_rails.setup_engine" , :group => :all do |app |
5
- if app . assets . nil?
6
- Sprockets . register_engine '.jsx' , React ::JSX ::Template
7
- else
8
- app . assets . register_engine '.jsx' , React ::JSX ::Template
9
- end
5
+ sprockets_env = app . assets || Sprockets # Sprockets 3.x expects this in a different place
6
+ sprockets_env . register_engine ( ".jsx" , React ::JSX ::Template )
10
7
end
11
8
end
12
9
end
Original file line number Diff line number Diff line change @@ -38,11 +38,8 @@ class Railtie < ::Rails::Railtie
38
38
addons : app . config . react . addons ,
39
39
} )
40
40
41
- if app . assets . nil?
42
- app . config . assets . version = [ app . config . assets . version , "react-#{ asset_variant . react_build } " , ] . compact . join ( '-' )
43
- else
44
- app . assets . version = [ app . assets . version , "react-#{ asset_variant . react_build } " , ] . compact . join ( '-' )
45
- end
41
+ sprockets_env = app . assets || app . config . assets # sprockets-rails 3.x attaches this at a different config
42
+ sprockets_env . version = [ sprockets_env . version , "react-#{ asset_variant . react_build } " , ] . compact . join ( '-' )
46
43
47
44
end
48
45
You can’t perform that action at this time.
0 commit comments