rest_framework 0.6.11 → 0.6.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/app/views/layouts/rest_framework.html.erb +4 -3
- data/lib/rest_framework/controller_mixins/models.rb +12 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fcc66a1bc2a8c965fcaf04106db51a08c98623a642803634fc96d5eccce9283f
|
4
|
+
data.tar.gz: 06c49e1eb116813833c01810379a7f377023bb37a0bb57429c254224f8b260d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6398f494b9c920a0e9765733c6be871d0cdee94fc12a2863fa7bf0bfc1bba41f601713a53b61ba3d57fcd1b3b45001eadbe6ac26b77b4bd69595ad1ae84e2f06
|
7
|
+
data.tar.gz: 2610d28a5d5b98fd6be70105d04a292d2acb4c3efc9d5ece74ba1a00b90e4968a55ccefc824773c2609015298221c5315ea929440e29923bba9500ce495c8c78
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.13
|
@@ -22,16 +22,17 @@
|
|
22
22
|
<nav>
|
23
23
|
<ol class="breadcrumb">
|
24
24
|
<%
|
25
|
-
breadcrumbs = request.path.split("/").inject([
|
25
|
+
breadcrumbs = request.path.split("/").inject([]) { |breadcrumbs, part|
|
26
26
|
# Ignore blank parts of the path (leading slash or double-slashes).
|
27
27
|
next breadcrumbs if part.blank?
|
28
28
|
|
29
|
-
last_path = breadcrumbs
|
29
|
+
last_path = breadcrumbs.last&.first || "/"
|
30
30
|
breadcrumbs << [
|
31
31
|
[last_path, part].join(last_path[-1] == "/" ? "" : "/"),
|
32
32
|
part,
|
33
33
|
]
|
34
|
-
|
34
|
+
|
35
|
+
next breadcrumbs
|
35
36
|
}
|
36
37
|
%>
|
37
38
|
<% breadcrumbs.each_with_index do |(path, label), i| %>
|
@@ -13,19 +13,24 @@ module RESTFramework::BaseModelControllerMixin
|
|
13
13
|
return @model if @model
|
14
14
|
return (@model = self.model) if self.model
|
15
15
|
|
16
|
+
# Try to determine model from controller name.
|
17
|
+
begin
|
18
|
+
return @model = self.name.demodulize.chomp("Controller").singularize.constantize
|
19
|
+
rescue NameError
|
20
|
+
end
|
21
|
+
|
16
22
|
# Delegate to the recordset's model, if it's defined.
|
17
23
|
unless from_get_recordset # Prevent infinite recursion.
|
18
|
-
|
24
|
+
# Instantiate a new controller to get the recordset.
|
25
|
+
controller = self.new
|
26
|
+
controller.request = ActionController::TestRequest.new
|
27
|
+
controller.params = {}
|
28
|
+
|
29
|
+
if (recordset = controller.get_recordset)
|
19
30
|
return @model = recordset.klass
|
20
31
|
end
|
21
32
|
end
|
22
33
|
|
23
|
-
# Try to determine model from controller name.
|
24
|
-
begin
|
25
|
-
return @model = self.name.demodulize.match(/(.*)Controller/)[1].singularize.constantize
|
26
|
-
rescue NameError
|
27
|
-
end
|
28
|
-
|
29
34
|
return nil
|
30
35
|
end
|
31
36
|
|