hobo 2.0.0.pre9 → 2.0.0.pre10
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/helpers/hobo_route_helper.rb +12 -4
- metadata +8 -8
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.0.
|
1
|
+
2.0.0.pre10
|
@@ -6,7 +6,7 @@ module HoboRouteHelper
|
|
6
6
|
unless Rails.configuration.hobo.dont_emit_deprecated_routes
|
7
7
|
old_ = object_url_old(obj, *args)
|
8
8
|
debugger if old_ != new_
|
9
|
-
|
9
|
+
Rails.logger.debug "new style url #{new_} does not match old style url #{old_}. obj: #{obj.inspect}. args: #{args.inspect}. backtrace: #{caller.inspect}" if old_ != new_
|
10
10
|
end
|
11
11
|
new_
|
12
12
|
end
|
@@ -99,7 +99,15 @@ module HoboRouteHelper
|
|
99
99
|
when 'put'; :update
|
100
100
|
when 'post'; :create
|
101
101
|
when 'delete'; :destroy
|
102
|
-
else
|
102
|
+
else if obj.is_a?(Class) || obj.respond_to?(:length)
|
103
|
+
:index
|
104
|
+
else
|
105
|
+
if obj.try.new_record?
|
106
|
+
return nil
|
107
|
+
else
|
108
|
+
:show
|
109
|
+
end
|
110
|
+
end
|
103
111
|
end
|
104
112
|
|
105
113
|
params[:action] = action unless action.in?(IMPLICIT_ACTIONS)
|
@@ -120,7 +128,7 @@ module HoboRouteHelper
|
|
120
128
|
poly = [obj]
|
121
129
|
end
|
122
130
|
|
123
|
-
poly = [options[:subsite]] + poly if options[:subsite]
|
131
|
+
poly = [options[:subsite]] + poly if !options[:subsite].blank?
|
124
132
|
|
125
133
|
begin
|
126
134
|
base_url = url = polymorphic_path(poly, params)
|
@@ -130,7 +138,7 @@ module HoboRouteHelper
|
|
130
138
|
base_url = url.gsub(/^#{Rails.application.config.action_controller.relative_url_root}/, "")
|
131
139
|
end
|
132
140
|
recognized_params = Rails.application.routes.recognize_path(base_url, {:method => options[:method]})
|
133
|
-
|
141
|
+
url
|
134
142
|
rescue NoMethodError => e # raised if polymorphic_url fails
|
135
143
|
nil
|
136
144
|
rescue ArgumentError => e # raised from polymorphic_url
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hobo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.pre10
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: hobo_support
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 2.0.0.
|
21
|
+
version: 2.0.0.pre10
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - '='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 2.0.0.
|
29
|
+
version: 2.0.0.pre10
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: hobo_fields
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -34,7 +34,7 @@ dependencies:
|
|
34
34
|
requirements:
|
35
35
|
- - '='
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version: 2.0.0.
|
37
|
+
version: 2.0.0.pre10
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -42,7 +42,7 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - '='
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: 2.0.0.
|
45
|
+
version: 2.0.0.pre10
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: dryml
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - '='
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 2.0.0.
|
53
|
+
version: 2.0.0.pre10
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,7 +58,7 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 2.0.0.
|
61
|
+
version: 2.0.0.pre10
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: will_paginate
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|