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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 17b09099951dd3c119b970bf253d0e825665f234
4
- data.tar.gz: aeee964355b5805e3b923c2ed8237ea4e1843993
3
+ metadata.gz: 94bda3a08748c63e1c9589733d101e1b8e405257
4
+ data.tar.gz: f32400f2da3aa6bec3148547081cae53e77d95c6
5
5
  SHA512:
6
- metadata.gz: 19fae4e92306b9d9f23ea120d65f32ed1f8d5dae8ff18b6a634df0a11fa0e34f40bfffd8f65c52a9c3183c14d0f082525bc95db1c134198848c2b51951efabb2
7
- data.tar.gz: f3da2b627943094e54f2014f538c2077f9d616eb7ed87fdb7624726cd1e28317a05010945bc13fe31f6dd4e45b3f4645397335b14ede44a2674542bae251bca0
6
+ metadata.gz: 739c0152f7d440928c6be349377da0e9b75388c01c7e8ed58bb0b5c059b14367cc704a5562682adcbbb0c8991d0e84ac0112f07703d0f3dccbb916c265e757ad
7
+ data.tar.gz: b10a3d6c1ac0414a1bb6ccd16cf5e44eeec61ffbf807c11f6ef75fe8a9211ccdc583c4d127668e1ce2890d254f19bd12912dadb6d05974bc3c3e061ff4390269
@@ -25,7 +25,7 @@ module StrongRoutes
25
25
  end
26
26
 
27
27
  def #{name}?
28
- self[:#{name}].nil?
28
+ !! self[:#{name}]
29
29
  end
30
30
  METHOD
31
31
  end
@@ -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 = ::StrongRoutes.config
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 += ::StrongRoutes::Rails::RouteMapper.map(app.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, ::StrongRoutes::Allow)
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, ::StrongRoutes::Allow)
20
+ app.config.middleware.insert_after(config.strong_routes.insert_after, Allow)
17
21
  else
18
- app.config.middleware.insert_before(::Rails::Rack::Logger, ::StrongRoutes::Allow)
22
+ app.config.middleware.insert_before(::Rails::Rack::Logger, Allow)
19
23
  end
20
24
  end
21
25
  end
@@ -1,3 +1,3 @@
1
1
  module StrongRoutes
2
- VERSION = "0.9.1"
2
+ VERSION = "0.9.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strong_routes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Hutchison