rest_framework 0.6.12 → 0.6.13

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
  SHA256:
3
- metadata.gz: 83aa878ffb9690b53552092a99987e67a9930f321c9ca02b97123b003d6c6f89
4
- data.tar.gz: d3e61c32bda1e7815822caabcedf508b03eec417f62507539d6d0e128697dc8e
3
+ metadata.gz: fcc66a1bc2a8c965fcaf04106db51a08c98623a642803634fc96d5eccce9283f
4
+ data.tar.gz: 06c49e1eb116813833c01810379a7f377023bb37a0bb57429c254224f8b260d9
5
5
  SHA512:
6
- metadata.gz: c78e80cba4939aa6bd951f93c055f27a07ff2fa0e6f24fb3bf5edfc3de35297fd6090dc98dbd0b9ecad027d80abb4602c1ebd898ef0ae43ccaf8a22018108d8f
7
- data.tar.gz: dc8240f44f4a315d47f47727fac2aae6b1ba8da73c0faecffa3b9e4174709e5d0966e7776aa38893801ff8ec2b83ac60a50f3ff963ad8a4d3873bd077c9f5af8
6
+ metadata.gz: 6398f494b9c920a0e9765733c6be871d0cdee94fc12a2863fa7bf0bfc1bba41f601713a53b61ba3d57fcd1b3b45001eadbe6ac26b77b4bd69595ad1ae84e2f06
7
+ data.tar.gz: 2610d28a5d5b98fd6be70105d04a292d2acb4c3efc9d5ece74ba1a00b90e4968a55ccefc824773c2609015298221c5315ea929440e29923bba9500ce495c8c78
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.12
1
+ 0.6.13
@@ -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.12
4
+ version: 0.6.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregory N. Schmit