strong_routes 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/strong_routes/config.rb +1 -1
- data/lib/strong_routes/rails/railtie.rb +9 -5
- data/lib/strong_routes/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94bda3a08748c63e1c9589733d101e1b8e405257
|
4
|
+
data.tar.gz: f32400f2da3aa6bec3148547081cae53e77d95c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 739c0152f7d440928c6be349377da0e9b75388c01c7e8ed58bb0b5c059b14367cc704a5562682adcbbb0c8991d0e84ac0112f07703d0f3dccbb916c265e757ad
|
7
|
+
data.tar.gz: b10a3d6c1ac0414a1bb6ccd16cf5e44eeec61ffbf807c11f6ef75fe8a9211ccdc583c4d127668e1ce2890d254f19bd12912dadb6d05974bc3c3e061ff4390269
|
data/lib/strong_routes/config.rb
CHANGED
@@ -3,19 +3,23 @@ require 'strong_routes/rails/route_mapper'
|
|
3
3
|
module StrongRoutes
|
4
4
|
module Rails
|
5
5
|
class Railtie < ::Rails::Railtie
|
6
|
-
config.strong_routes =
|
6
|
+
config.strong_routes = StrongRoutes.config
|
7
7
|
|
8
8
|
initializer 'strong_routes.initialize' do |app|
|
9
|
+
# Need to force Rails to load the routes since there's no way to hook
|
10
|
+
# in after routes are loaded
|
11
|
+
app.reload_routes!
|
12
|
+
|
9
13
|
config.strong_routes.allowed_routes ||= []
|
10
|
-
config.strong_routes.allowed_routes +=
|
14
|
+
config.strong_routes.allowed_routes += RouteMapper.map(app.routes)
|
11
15
|
|
12
16
|
case
|
13
17
|
when config.strong_routes.insert_before? then
|
14
|
-
app.config.middleware.insert_before(config.strong_routes.insert_before,
|
18
|
+
app.config.middleware.insert_before(config.strong_routes.insert_before, Allow)
|
15
19
|
when config.strong_routes.insert_after? then
|
16
|
-
app.config.middleware.insert_after(config.strong_routes.insert_after,
|
20
|
+
app.config.middleware.insert_after(config.strong_routes.insert_after, Allow)
|
17
21
|
else
|
18
|
-
app.config.middleware.insert_before(::Rails::Rack::Logger,
|
22
|
+
app.config.middleware.insert_before(::Rails::Rack::Logger, Allow)
|
19
23
|
end
|
20
24
|
end
|
21
25
|
end
|