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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b50de92e6da78551111f0fd642d6e4ed931528036e455cea60edf89ec562c9f7
4
- data.tar.gz: e603daa202d4798d1b11e821084d92a0114931639ddc6198d87243494c65e74d
3
+ metadata.gz: fcc66a1bc2a8c965fcaf04106db51a08c98623a642803634fc96d5eccce9283f
4
+ data.tar.gz: 06c49e1eb116813833c01810379a7f377023bb37a0bb57429c254224f8b260d9
5
5
  SHA512:
6
- metadata.gz: bf66b77f4ad8bfa0fe05c38e0cb1e9d73f0c9cb48b92c8c57401510062522fb1715f1699641c7455a69838380bffff1b67dc0bd4dbc10d53e242c08ce604b40c
7
- data.tar.gz: cb1e8f11488a8d108d4a40593906ca1c1718b2b762c5049625ee206aee01c50dc818fcca369e258b89c144cc0c0c4a703ac8f6ca1bdc47c7082e447bbfbe8b8c
6
+ metadata.gz: 6398f494b9c920a0e9765733c6be871d0cdee94fc12a2863fa7bf0bfc1bba41f601713a53b61ba3d57fcd1b3b45001eadbe6ac26b77b4bd69595ad1ae84e2f06
7
+ data.tar.gz: 2610d28a5d5b98fd6be70105d04a292d2acb4c3efc9d5ece74ba1a00b90e4968a55ccefc824773c2609015298221c5315ea929440e29923bba9500ce495c8c78
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.11
1
+ 0.6.13
@@ -22,16 +22,17 @@
22
22
  <nav>
23
23
  <ol class="breadcrumb">
24
24
  <%
25
- breadcrumbs = request.path.split("/").inject([["/", "(root)"]]) { |breadcrumbs, part|
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[-1][0]
29
+ last_path = breadcrumbs.last&.first || "/"
30
30
  breadcrumbs << [
31
31
  [last_path, part].join(last_path[-1] == "/" ? "" : "/"),
32
32
  part,
33
33
  ]
34
- breadcrumbs
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
- if (recordset = self.new.get_recordset)
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rest_framework
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.11
4
+ version: 0.6.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregory N. Schmit